title: Getting eBay Access token
body: <p><strong>Having problem getting eBay access token using Delphi.</strong></p>
  
  <p>When I run it and click on button I should get access token but I'm getting</p>
  
  <blockquote>
    <p>Exception EHTTPProtocolException 'HTTP/1.1 401 Unauthorized'</p>
  </blockquote>
  
  <p>When I click continue. Message dialog appears with meessege</p>
  
  <blockquote>
    <p>{"error":"invalid_client", "error_description":"client authentication
    failed"}</p>
  </blockquote>
  
  <p>My Delphi code:</p>
  
  <pre><code>procedure TForm5.btn1Click(Sender: TObject);
  var
   vClientId, vClientSecret : string;
   vBase64 : String;
   vRuNames : string;
  begin
    vClientId:='jackjump-xxxx-SBX-15d7a0307-68d66d5a';
    vClientSecret:='SBX-5d7a03073f13-cb20-4a72-b71e-4e53';
    vBase64:=TNetEncoding.Base64.Encode(vClientId+':'+vClientSecret);
    vRuNames:='jack_jumping-jackjump-xxxx--tbccomu';
  
    RESTRequest1.Method:=rmPOST;
    RESTRequest1.Resource:='/identity/v1/oauth2/token';    
    RESTRequest1.AddParameter('Authorization', 'Basic '+vBase64, pkHTTPHEADER);
    RESTRequest1.AddParameter('grant_type','client_credentials', pkREQUESTBODY);
    RESTRequest1.AddParameter('redirect_uri',vRuNames, pkREQUESTBODY);
    RESTRequest1.AddParameter('scope','https://api.ebay.com/oauth/api_scope', pkREQUESTBODY);
  
  
    RESTRequest1.Execute;
    ShowMessage(RESTResponse1.Content);
  end;
  </code></pre>