0

When calling the surveymonkey api I'm using {\"survey_id\":\"47625442\"," +"\"fields[]\":\"['url']\"}" as the json data the server needs to complete my request. while it is returning the data it is required it is not returning the additional URL i believe i am requesting. Does anyone know why this wouldn't give me this back?

EDIT https://developer.surveymonkey.com/mashery/get_collector_list this is the call im trying to make if this helps

  • unclear what you are asking.. – L.B Dec 30 '13 at 20:05
  • I'm not getting back the url that i am requesting. Am i formatting the json string incorrectly for this to work? – Arachnid Hivemind Dec 30 '13 at 20:18
  • 1
    I still don't understand what you are asking but, the json in your question `{"survey_id":"47625442","fields[]":"['url']"}` is not valid. – L.B Dec 30 '13 at 20:20
  • Hows this. The post request that im making to the api takes json as data to get information about the surveys back. How should i be formating this json so that it has the survey id as a string and the fields with "url" as an array? – Arachnid Hivemind Dec 30 '13 at 20:25

1 Answers1

3

As was pointed out in the comments: Your JSON formatting is off, so the API doesn't understand that you're asking for the URL.

For an understanding of what's going on, take a look at the example request in the link you provided; note the format of the fields section.

Try again, this time with:

{"survey_id": "47625442", "fields": ["url"]}

...which with the escapes will look like this....

    {\"survey_id\": \"47625442\", \"fields\":[ \"url\" ]}"
SWalters
  • 3,615
  • 5
  • 30
  • 37