question

rami_heled avatar image
0 Likes"
rami_heled asked ·

token - bad request trying to get token

this is my code var clientString = clientId + ":" + clientSecret; byte[] clientEncode = Encoding.UTF8.GetBytes(clientString); var credentials = "Basic " + System.Convert.ToBase64String(clientEncode); string URL = " https://api.ebay.com/identity/v1/oauth2/token";; HttpWebRequest request = WebRequest.Create(URL) as HttpWebRequest; request.ContentType = "application/x-www-form-urlencoded"; request.Method = "POST"; request.Timeout = Timeout.Infinite; request.KeepAlive = true; request.Headers.Add(HttpRequestHeader.Authorization, credentials); var body = "grant_type=authorization_code&code=" + Code + "&redirect_uri=" + redirect_uri; byte[] formData = UTF8Encoding.UTF8.GetBytes(body); request.ContentLength = formData.Length; using (Stream post = request.GetRequestStream()) { post.Write(formData, 0, formData.Length); } var responsessss = (HttpWebResponse)request.GetResponse(); i crash after that
token
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.

anisha_developersupport avatar image
0 Likes"
anisha_developersupport answered ·
Hi @rami_heled, When we check at our end, we can get user access token for Identity API successfully. To get User Access token, please follow steps provided in following links : https://developer.ebay.com/api-docs/static/oauth-authorization-code-grant.html If you still need further assistance,please let us know. 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.

nochkin avatar image
0 Likes"
nochkin answered ·
If your app crashed somewhere, you have a better chance to ask your question on Stackoverflow.com as it appears to be not related to eBay API. Make sure you also provide your crash report as it's not clear from your message at which point it crashed.
· 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.