Note that there are some explanatory texts on larger screens.

plurals
  1. POGotoWebinar REST API - Custom Questions
    primarykey
    data
    text
    <p>Please save me stack overflow .. and I'm PRAYING someone has registered a participant using the API (and submitting an answer to a custom question).</p> <p>Ok, so first off, here's the documentation for create registrant:</p> <pre><code>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 } ] } </code></pre> <p>So, as you can see from the json rest example above, the REST body needs to be an array for the "normal" values such as name, email, etc...</p> <p>If you look near the bottom of the example, you'll see an array inside this array, called responses..</p> <p>This array contains arrays of the custom question IDs and the user responses.</p> <p>So what happens when there's only one custom question?</p> <p>I have tried:</p> <pre><code>array('firstName' =&gt; $fname, 'lastName' =&gt; $lname, 'email' =&gt; $em, 'responses' =&gt; array('questionKey' =&gt; 300000000000042400, 'responseText' =&gt; $custom)); </code></pre> <p>and also tried (an array of arrays even though there's only one question):</p> <pre><code>array('firstName' =&gt; $fname, 'lastName' =&gt; $lname, 'email' =&gt; $em, 'responses' =&gt; array(array('questionKey' =&gt; 300000000000042400, 'responseText' =&gt; $custom))); </code></pre> <p>If I run a json_encode on my data, This is the output</p> <pre><code>{ "firstName":"Ellis", "lastName":"Ryan", "email":"ryanthecloser@gmail.com", "responses":[ { "questionKey":3.0e+17, "responseText":"http:\/\/facebook.com\/doubleyourlikes" } ] } </code></pre> <p>While I was typing this question, I think I see the issue ... my json data (more specifically questionkey) is being converted to scientific notation ... I tried submitting questionKey as a string, but that did not work..</p> <p>I'm hoping the scientific notation is the problem. Anyone have any ideas how to make a number in php this big: 300000000000042400</p> <p>And be able to encode_json without having the number converted? Or, if anyone has successfully gotten custom question responses to appear for a registrant using the api, please let me know!</p> <p>Thanks in advance!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload