Hot answers tagged api-help
4
First of all, I'm guessing the HTTP 400 errors are directly related to the fact that you are transmitting the access_token over standard HTTP instead of HTTPS. The API (if I remember correctly) throws an error if you try to pass an access token over standard HTTP and immediately invalidates the token.
You actually don't need to include an access_token to ...
1
/me/associated is the preferred way to turn an access_token into a list of users, it returns the collection of per-site user details that can be quickly fetched. It's basically the user's account tab.
If you need more details about a user on a give site, then turn around and hit /me (or /users/{ids}) on the sites you've discovered via /me/associated.
As ...
1
/questions take's a semi-colon delimited list of tags in the tagged parameter. If tagged is set, questions returned will have all the passed tags (ie. it's an AND operator).
https://api.stackexchange.com/docs/questions#order=desc&sort=votes&tagged=python&filter=default&site=stackoverflow&run=true
^ for example, that query returns all ...
1
For one use the current API version (2.1) instead of an old one (1.1 in your case).
Furthermore, when using JSONP you do not have to parse the result. The data object you get in your success method already is a JavaScript object you can work with.
$(function(){
$.ajax({
url: ...
1
The API expects JSONP requests to specify the callback as the jsonp parameter, not the callback that jQuery uses by default.
While really you should consider upgrading to API 2.1, which does expect callback (and allows CORS, for that matter), you can fix your code by putting in the jsonp parameter placeholder:
$.ajax({
...
Only top voted, non community-wiki answers of a minimum length are eligible