I'm trying to call the people api through AJAX using jquery but the response doesnt seem to have a callback wrapper, which causes an error. here is some sample code:
data = {
"access_token" : token
};
$.ajax({
url: peopleIndexUrl,
type: "GET",
cache: false,
data: data,
dataType: 'jsonp',
success: function(data,textStatus,jqXHR){
console.log(data);
},
error: function(jqXHR,textStatus,errorThrown){
console.log(errorThrown);
}
});
}
The call does seem to go through fine. Perhaps I have to change the callback? Thanks.
Submitted
Official response fromEric, JSONP is supported for our API endpoints with the exception of stuff like the /oauth/token endpoint. You should be able to use it with endpoints like /api/v1/people
You also want to wrap your calls in JSONP. So:
https://yournation.nationbuilder.com/api/v1/people.jsonp
not,
https://yournation.nationbuilder.com/api/v1/people
If you continue to run into trouble, you can email us a text file with http request and response samples, using something like www.runscope.com, to [email protected].
Showing 1 reaction
Sign in with