question

sendchargde-0 avatar image
2 Likes"
sendchargde-0 asked ·

"Invalid request" while trying to get a user token - no specific error number given,"Invalid Request" trying to get a user token - No detail given

This is the extremely vague response I'm getting, while trying to get a user access token: { "error":"invalid_request", "error_description":"request is invalid", "error_uri":null" } How can I begin to debug this when it doesn't even hint at what's wrong with my request? I've been through this page step-by-step: http://developer.ebay.com/devzone/rest/ebay-rest/content/gen-user-token.html This is basically the code I'm using (some values hidden): $ebay_token_url = ' https://api.sandbox.ebay.com/identity/v1/oauth2/token'; $ebay_client_id = 'abc'; $ebay_client_secret = 'xyz'; $ebay_redirect_uri = '123'; $curl_params = [ 'grant_type' => 'authorization_code', 'code' => $auth_code, 'redirect_uri' => $ebay_redirect_uri, ]; $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, $ebay_token_url); curl_setopt($curl_handle, CURLOPT_HTTPHEADER, [ "Content-Type: application/x-www-form-urlencoded", "Authorization: Basic " . base64_encode($ebay_client_id . ':' . $ebay_client_secret) ]); curl_setopt($curl_handle, CURLOPT_POST, true); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, $curl_params); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false); $curl_response = curl_exec($curl_handle); $curl_error = curl_errno($curl_handle); if ($curl_error) { $curl_error = curl_error($curl_handle); }
tokenserror-sandboxuser tokeninvalid request
· 2
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.

I have the same error: did you solved?
0 Likes 0 · ·
I have the same error. I try many ways but get the same error. Did you solve it?
0 Likes 0 · ·
smtyson94 avatar image
0 Likes"
smtyson94 answered ·
Hi @decoderworld , I am trying to fetch a user token using the same coding you provided. But, on running this code, it says : {"error":"invalid_grant","error_description":"the provided authorization grant code is invalid or was issued to another client"} . Could you please explain, how can I get the value of "$auth_code" in your code: $auth_code="mycode^1.1#i^1#f^0#p^3#I^3#r^1#t^Ul4xXzVERjJDQzQyRTkwREFEMDk1MDg5RjIxMUFEMUE4NjBGXzNfMSNFXjEyODQ="; Where do I get this value from my ebay sandbox? Please help me as I am new to ebay API integration and working on very urgent project. Please reply ASAP. Thanks, Riten
· 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.

decoderworld avatar image
0 Likes"
decoderworld answered ·
Here's a code that works for me:
· 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.