Take the 2-minute tour ×
Stack Apps is a question and answer site for apps, scripts, and development with the Stack Exchange API. It's 100% free, no registration required.

I am attempting to use the /me API to retrieve an authenticated user's details but I am recieving a 400 error.

I am able to complete the OAuth2 dance and have been able to capture the access token and expire value, but when I then go on to send my request to https://api.stackexchange.com/2.0/me?site=stackoverflow (including access token) it gives mea 400 error.

Here is what I am logging if its of any use:

GET request for "https://api.stackexchange.com/2.0/me?site=stackoverflow" resulted in 400 (Bad Request); invoking error handler
HttpClientErrorException while completing connection: 400 Bad Request
Response body: ?

Is there anything i am missing? other than just sending the access token to the above URL is there anything else i need to do?

Any help would be much appreciated.

share|improve this question
add comment

1 Answer 1

You need to pass your request key as well.

I'm not sure what you're using that isn't giving you the error message back, but if you had captured it you would have seen it said something like:

{
  "error_id":405,
  "error_name":"key_required","
  error_message":"`key` is required when `access_token` is passed."
}
share|improve this answer
    
Thanks - I thought that the key was only required in cases where the access token is not being passed - the only thing I can find in the docs about is this: "Pass this as key when making requests against the Stack Exchange API to receive a higher request quota." Is there any documentation detailing that it is required? –  rhinds Mar 26 '12 at 10:36
    
@rhinds - looks like a documentation oversight, I'll get it fixed in the next deploy. –  Kevin Montrose Mar 26 '12 at 17:13
    
Great thanks - am going to try including my key in the request. –  rhinds Mar 26 '12 at 17:35
    
Hi @Kevin Montrose, I have just come back to this project (having been working on other things) - I have now updated my request to include the key (now hitting: api.stackexchange.com/2.0/me?site=stackoverflow&key=XXXXXXX) and including the access_token, but I am still getting the same "resulted in 400 (Bad Request)" Error - any other ideas or suggestions? –  rhinds May 19 '12 at 21:12
add comment

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .