Chilkat Online Tools

delphiAx / Salesforce Platform APIs / Resources

Back to Collection Items

var
http: TChilkatHttp;
success: Integer;
queryParams: TChilkatJsonObject;
resp: IChilkatHttpResponse;

begin
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

http := TChilkatHttp.Create(Self);

queryParams := TChilkatJsonObject.Create(Self);
queryParams.UpdateString('part','Key');

// Adds the "Authorization: Bearer <token>" header.
http.AuthToken := '<token>';

resp := http.QuickRequestParams('GET','https://login.salesforce.com{{site}}/services/data/v{{version}}/apps/oauth/credentials/{{_appId}}/{{_consumerId}}',queryParams.ControlInterface);
if (http.LastMethodSuccess = 0) then
  begin
    Memo1.Lines.Add(http.LastErrorText);
    Exit;
  end;

Memo1.Lines.Add(IntToStr(resp.StatusCode));
Memo1.Lines.Add(resp.BodyStr);

Curl Command

curl -G -d "part=Key"
	-H "Authorization: Bearer <token>"
https://login.salesforce.com{{site}}/services/data/v{{version}}/apps/oauth/credentials/{{_appId}}/{{_consumerId}}

Postman Collection Item JSON

{
  "name": "Resources",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Authorization",
        "value": "Bearer <token>",
        "description": "Replace <token> with your access token"
      }
    ],
    "url": {
      "raw": "{{url}}{{site}}/services/data/v{{version}}/apps/oauth/credentials/{{_appId}}/{{_consumerId}}?part=Key",
      "host": [
        "{{url}}{{site}}"
      ],
      "path": [
        "services",
        "data",
        "v{{version}}",
        "apps",
        "oauth",
        "credentials",
        "{{_appId}}",
        "{{_consumerId}}"
      ],
      "query": [
        {
          "key": "part",
          "value": "Key",
          "description": "Key, Secret, or KeyAndSecret"
        }
      ]
    },
    "description": "Returns credentials for a specific consumer. Use parameters to determine whether the request should return the key, the secret, or both key and secret. See [OAuth Credentials by Consumer ID](https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/connect_resources_credentials_by_app_and_consumer_id.htm)."
  },
  "response": [
  ]
}