从Quickblox自定义对象中的xml文件创建多个记录

时间:2014-01-25 14:48:46

标签: xml api rest quickblox

我有XML格式的不同课程(数百)的列表,我想在Quickblox自定义对象中创建多个记录,这是一个课程表。每个记录都是包含平台,Course_Name,Length,ImageURL,Start_Date等字段的课程。

生成会话令牌和签名后,我可以通过在命令行输入所有内容,使用以下命令创建一条记录。但是,我需要您的帮助来弄清楚如何使用XML文件以自动方式创建记录。我无法从关于创建多记录的Quickblox文档中弄清楚这一点

http://quickblox.com/developers/Custom_Objects#Create_multi_records

curl -X POST -H "QB-Token: 3842d6da71378aecd8409e8c68f" -d "Platform=Open2Study& \
Course_Name=Writing for the Web (WriteWeb)&University=open2study&Instructor=Frankie Madden& \
Length=4 weeks&Subject=Open 2 Study&GameModeID=3059&Language=English&
ImageURL=https://www.open2study.com/sites/default/files/styles/course_logo& \
VideoURL=https://www.youtube.com/embed/1ZzdrglOnDg?wmode=opaque& \
LinkURL=https://www.open2study.com/courses/writing-for-the-web& \
Prerequisites=All are welcome&Country=Australia& \
Summary=Find out how content can impact the reader's experience, as well as how the reader's 
experience can impact the way they interpret online content.& \
Efforts=Self study&SignupURL=https://www.open2study.com/enrol/319& \
Start_Date=18 Feb 2014&Type_of_certificate=Certificate of Achievement" https://api.quickblox.com
/data/tblCourses

1 个答案:

答案 0 :(得分:1)

尝试这样的方法在单个查询中创建多个记录:

curl -X POST -H "QB-Token: 281a7bc7c2984763ce77cda1b3641e551b93f887" -d "record[1][Platform]=...&record[1][Course_Name]=...&record[2][Platform]=...&record[2][Course_Name]=...&record[3][Platform]=...&record[3][Course_Name]=..." https://api.quickblox.com/data/tblCourses/multi