question

jacjumpin_0 avatar image
0 Likes"
jacjumpin_0 asked

I can not get Access token from eBay Selling api using DELPHI

OK as the title say. On my form i have RESTClient, rest request, rest response, OAUTH2 Autheniticator and a button components. I wont to get access token when i press the button. here is my code: procedure TForm5.btn1Click(Sender: TObject); var vClientId, vClientSecret : string; vBase64,vBase: String; vItem: TRESTRequestParameter; vRuNames, vIspravno, str : string; vOdgovor : string; vContent, vContent1: string; begin vClientId:='jackjump-proba-SBX-15d7a0307-68d66d5a'; vClientSecret:=':SBX-5d7a03073f13-cb20-4a72-b71e-4e53'; vBase:=vClientId+':'+vClientSecret; vBase64:='Basic '+TNetEncoding.Base64.Encode(vClientId+vClientSecret); vIspravno:='Basic amFja2p1bXAtcHJvYmEtU0JYLTE1ZDdhMDMwNy02OGQ2NmQ1YTpTQlgtNWQ3YTAzMDczZjEzLWNiMjAtNGE3Mi1iNzFlLTRlNTM='; vBase64 := StringReplace(vBase64, sLineBreak, '', [rfReplaceAll]); vRuNames:='jack_jumping-jackjump-proba--tbccomu'; RESTClient1:=TRESTClient.Create(' https://api.sandbox.ebay.com/'); RESTRequest1.Resource:='identity/v1/oauth2/token'; RESTRequest1.AddParameter('Content-Type', 'application/x-www-form-urlencoded', pkHTTPHEADER); RESTRequest1.AddParameter('Authorization', vBase64, pkHTTPHEADER); vContent :='grant_type=client_credentials&redirect_uri=jack_jumping-jackjump-proba--tbccomu&scope= https://api.ebay.com/oauth/api_scope'; RESTRequest1.Body.Add(vContent); RESTRequest1.Execute; end; and response is HTTP exception with status code 500 INTERNAL SERVER ERROR... PLIS HLP
delphiaccess tokjen
10 |600

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

0 Answers

·

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.