Reputation: 53606
I need to page the results I get back from Survey Monkey. I tried from the docs the following:
curl -i -X GET -H "Authorization:bearer my.access.token.which.i.have" -H "Content-Type": "application/json" https://api.surveymonkey.net/v3/surveys?page=2&per_page=5
the response seems to ignore the values I am sending in the url (page=2&per_page=8)
The response still has as per_page:50
as the header of the response, and the links
have, for example for prev
the value: https://api.surveymonkey.net/v3/surveys?page=1&per_page=50
What am I missing in the URL structure to get paging correctly?
I will point that I do get a result with my surveys back, which (probably) means I am setup properly to work with the API as far as credentials, correct url and scopes.
Upvotes: 1
Views: 331
Reputation: 45513
Add quotes around your url otherwise, your shell will interpret the first &
and will make the command on the left of &
run in background (thus ignoring all the parameters you have added on the right of it eg per_page=5
) :
curl -i -H "Authorization:bearer my.access.token.which.i.have" \
-H "Content-Type: application/json" \
"https://api.surveymonkey.net/v3/surveys?page=2&per_page=5"
Also -H "Content-Type": "application/json"
header is not correctly formatted
Upvotes: 2