question

rocksolidgear1 avatar image
0 Likes"
rocksolidgear1 asked

unsuppoted grant type error when trying to get token using restsharp

Here is the c# code with restsharp class that I am using: (attached)[link text][1] [1]: /storage/temp/ 1927-code.txt
token error
code.txt (698 B)
10 |600

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

1 Answer

·
rocksolidgear1 avatar image
0 Likes"
rocksolidgear1 answered
I solved the issue by modifying these 3 lines: request.AddParameter("code", code, ParameterType.RequestBody); request.AddParameter("grant_type", "authorization_code", ParameterType.RequestBody); request.AddParameter("redirect_uri", ebayRUName, ParameterType.RequestBody); to read: request.AddParameter("application/x-www-form-urlencoded","grant_type=authorization_code&code=" + code + "&redirect_uri=" + ebayRUName, ParameterType.RequestBody); I believe that the issue was related to not url encoding the body with "application/x-www-form-urlencoded"
10 |600

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.