Pregunta

I have a list of different courses (hundreds) in XML format and I want to create multi records in a Quickblox custom object which is a table of courses. Each record is a course with fields such as Platform, Course_Name, Length, ImageURL, Start_Date etc.

After generating a session token and a signature, I was able to create one record using the command below by typing everything on the command-line. However, I need your help to figure out how to use the XML file to create the records in an automated fashion. I was not able to figure this out from the Quickblox documentation on creating multi records

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
¿Fue útil?

Solución

Try something like this to create milti records in single query:

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
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top