question

jolip_35 avatar image
0 Likes"
jolip_35 asked ·

API OAuth2.0: unsupported_grant_type

I can't get past step 1. I've read that the scopes may not be correct but even if I cut all the scopes down to https://api.ebay.com/oauth/api_scope but I still get the same error. So I've registered as an ebay developer, I've setup a sandbox, I have a client ID, client Secret, Redirect URI and DevID. My endpoint is: https://auth.sandbox.ebay.com/oauth2/authorize I'm sending as headers: Content-Type: application/x-www-form-urlencoded Authorization: Basic ...base64encode.client_id:client_secret... The Payload consists of the grant_type (=authorization_code), code, and redirect_uri. But I still get this error: {error:unsupported_grant_type,error_description:grant type in request is not supported by the authorization server} Any ideas would be much appreciated as I've spent the past week on this issue.
oauth2access tokengrant_typerefresh tokenunsupported
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jolip_35 avatar image
0 Likes"
jolip_35 answered ·
Hi @Sanjeev_developersupport, Thank you so much for replying. Just to give some background I have built APIs connecting to Shopify, Xero and Google services using Oauth2.0 and I consider myself no expert but somewhat familiar with building APIs. So I have already signed up to the Ebay Developer Program, I have a normal Ebay account (real buyer/seller), I have a sandbox setup and a sandbox test user. I have read that perhaps I am confusing the accounts as per: https://developer.ebay.com/DevZone/guides/features-guide/default.html#Basics/Call-Making.html I have come across the link you sent me and I followed this through to step 2. I am using the sell API and have let the application key generate set all my scope(s) (I can post a list if necessary but I have checked that I have the right ones and they're available to Apps rather than just Users). I have completed step 1( https://auth.sandbox.ebay.com/oauth2/authorize?client_id=your_client_id &redirect_uri=your_redirect_uri_id &response_type=code &scope=URL-encoded-scope-name(s)&prompt=login). I login with my sandbox test user to agree to the "Grant Application Access" and successfully generate a code and get redirected to an ebay screen saying "Thank You. Authorization successfully completed". I also get the "code" value returned using the default redirects: https://signin.ebay.com/ws/eBayISAPI.dll?ThirdPartyAuthSucessFailure&isAuthSuccessful=true. That said I am in now step 2: my header is content-type=application/x-www-form-urlencoded, authorization=basic base64encoded(client_id:client_secret) and my payload is grant_type=authorization_code, code=url_decoded_code, redirect_uri=my_redirect_uri_code I still get the response: {error:unsupported_grant_type,error_description:grant type in request is not supported by the authorization server} I have tried reducing/increasing the scopes. I have tried different headers. I get this same error response in Postman and PHP/cURL scripts. If I get a user access token I can get locations and items in the sandbox (absolutely blank but returns an empty list without errors). I don't get why this error is not that common in the forums and on search engines. I cannot get around it.
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sanjeev_developersupport avatar image
0 Likes"
sanjeev_developersupport answered ·
Hi @jolip_35, Please go through the below docs hope it helps you. https://ebaydts.com/eBayKBDetails?KBid=5075 Best regards, eBay Developer Support
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.