php - GotoWebinar REST API - Custom Questions -
please save me stack overflow .. , i'm praying has registered participant using api (and submitting answer custom question).
ok, first off, here's documentation create registrant:
post https://api.citrixonline.com/g2w/rest/organizers/73563532324/webinars/89... http/1.1 accept: application/json accept: application/vnd.citrix.g2wapi-v1.1+json content-type: application/json authorization: oauth oauth_token={oauthtoken} { "firstname":"saumil", "lastname":"jhaveri", "email":"test@test.com", "address":"650+townsend+st,+st.+325", "city":"san+francisco", "state":"california", "zipcode":"94103", "country":"united+states", "phone":"3123751884", "industry":"accounting", "organization":"citrix", "jobtitle":"software+engineer", "purchasingtimeframe":"13+months", "roleinpurchaseprocess":"decision+maker", "numberofemployees":"120", "questionsandcomments":"no+comments!", "responses":[ { "questionkey":152, "responsetext":"fantastic!" }, { "questionkey":151, "answerkey":152 } ] } so, can see json rest example above, rest body needs array "normal" values such name, email, etc...
if near bottom of example, you'll see array inside array, called responses..
this array contains arrays of custom question ids , user responses.
so happens when there's 1 custom question?
i have tried:
array('firstname' => $fname, 'lastname' => $lname, 'email' => $em, 'responses' => array('questionkey' => 300000000000042400, 'responsetext' => $custom)); and tried (an array of arrays though there's 1 question):
array('firstname' => $fname, 'lastname' => $lname, 'email' => $em, 'responses' => array(array('questionkey' => 300000000000042400, 'responsetext' => $custom))); if run json_encode on data, output
{ "firstname":"ellis", "lastname":"ryan", "email":"ryanthecloser@gmail.com", "responses":[ { "questionkey":3.0e+17, "responsetext":"http:\/\/facebook.com\/doubleyourlikes" } ] } while typing question, think see issue ... json data (more questionkey) being converted scientific notation ... tried submitting questionkey string, did not work..
i'm hoping scientific notation problem. have ideas how make number in php big: 300000000000042400
and able encode_json without having number converted? or, if has gotten custom question responses appear registrant using api, please let me know!
thanks in advance!
sigh
passing questionkey string 100% fine, problem gone...
my issue there's 2 versions of create registrant:
version one: accepts name , email , discards else version two: add
accept: application/vnd.citrix.g2wapi-v1.1+json
to headers select second version. second version allows custom fields.
because didn't include header param, custom field data discarded!
grrrr read tons of times in documentation ... rtm!, , says lol!
Comments
Post a Comment