cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can't Refresh User Access Token using refresh_token

I am Japanese and not good at English.

I'm using a translation site, so I'm sorry if my grammar is incorrect.

 

I am currently testing the authentication function in the Sandbox environment.

 

The first time I obtained a User Access Token, it worked, but when I tried to refresh the Access Token using the obtained refresh_token, I got a 500 error.

 

#cURL command in Linux
curl -X POST 'https://api.sandbox.ebay.com/identity/v1/oauth2/token' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Authorization: Basic *****' -d 'grant_type=refresh_token&refresh_token=*****&scope=https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope%2Fcommerce.identity.readonly+https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope%2Fcommerce.identity.name.readonly+https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope%2 Fcommerce.identity.address.readonly+https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope%2Fcommerce.identity.email.readonly+https%3A%2F%2Fapi.ebay.com%2Foauth%2Fapi_scope%2Fcommerce.identity.phone.readonly'

 

#Error
{"error":"server_error","error_description":"server encountered an unexpected condition that prevented it from fulfilling the request"}

 

#Other
- I don't think there's any mistake because I'm using the same "OAuth credentials" as when I first obtained the Access Token.
- I'm using a URL-encoded refresh_token.

 

I also tried implementing the following Python code, but the result was the same (500 error).

 

#Python code
req_header = {
   "Content-Type": "application/x-www-form-urlencoded",
   "Authorization": "Basic " + (base64.b64encode((appID+":"+certID).encode())).decode("utf-8"),
}
req_data = {
   "grant_type": "refresh_token",
   "refresh_token": aToken_Refresh,
   "scope": token_scope,
}

req = urllib.request.Request(get_token_url_sandbox, data=urllib.parse.urlencode(req_data).encode(), headers=req_header)
aToken = urllib.request.urlopen(req)
json.loads(aToken.read())

 

Can you tell me what's wrong?

 

Thank you.

Message 1 of 5
latest reply
1 BEST ANSWER

Accepted Solutions

Re: Can't Refresh User Access Token using refresh_token

There is an issue with the sandbox. I faced the same issue, but when I tried with the production environment, it worked fine. I was able to refresh the access token.

View Best Answer in original post

Message 2 of 5
latest reply
4 REPLIES 4

Re: Can't Refresh User Access Token using refresh_token

There is an issue with the sandbox. I faced the same issue, but when I tried with the production environment, it worked fine. I was able to refresh the access token.

Message 2 of 5
latest reply

Re: Can't Refresh User Access Token using refresh_token

Thank you for your reply.

 

I understand that it was a problem with the sandbox environment. 

I was relieved to find out that it wasn't my program that was causing the problem.

Message 3 of 5
latest reply

Re: Can't Refresh User Access Token using refresh_token

Hi @jagadegos0  @madao0492 

 

Refresh token API call is failing with the error code 500 "Internal server error" in the Sandbox. We are aware of the issue and actively working to get it fixed. 

 

You can check the API Status page: https://developer.ebay.com/support/api-status  to stay updated on current system issues with eBay APIs.

Best Regards,
eBay Developer Support
Message 4 of 5
latest reply

Re: Can't Refresh User Access Token using refresh_token

Hello developer_support@ebay ,

 

It seems like this issue has come back and I do not see it acknowledged in the api status page.

Message 5 of 5
latest reply