Chilkat Online Tools

delphiDll / DocuSign Admin API / Returns the list of organizations of which the authenticated user is a member.

Back to Collection Items

var
http: HCkHttp;
success: Boolean;
queryParams: HCkJsonObject;
resp: HCkHttpResponse;

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

http := CkHttp_Create();

queryParams := CkJsonObject_Create();
CkJsonObject_UpdateString(queryParams,'mode','{{mode}}');

CkHttp_SetRequestHeader(http,'Content-Type','application/json');
// Adds the "Authorization: Bearer {{accessToken}}" header.
CkHttp_putAuthToken(http,'{{accessToken}}');
CkHttp_SetRequestHeader(http,'Accept','application/json');

resp := CkHttp_QuickRequestParams(http,'GET','https://{{hostenv}}/Management/v2/organizations',queryParams);
if (CkHttp_getLastMethodSuccess(http) = False) then
  begin
    Memo1.Lines.Add(CkHttp__lastErrorText(http));
    Exit;
  end;

Memo1.Lines.Add(IntToStr(CkHttpResponse_getStatusCode(resp)));
Memo1.Lines.Add(CkHttpResponse__bodyStr(resp));
CkHttpResponse_Dispose(resp);

CkHttp_Dispose(http);
CkJsonObject_Dispose(queryParams);

Curl Command

curl -G -d "mode=%7B%7Bmode%7D%7D"
	-H "Accept: application/json"
	-H "Content-Type: application/json"
	-H "Authorization: Bearer {{accessToken}}"
https://{{hostenv}}/Management/v2/organizations

Postman Collection Item JSON

{
  "name": "Returns the list of organizations of which the authenticated user is a member.",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "url": {
      "raw": "https://{{hostenv}}/Management/v2/organizations?mode={{mode}}",
      "protocol": "https",
      "host": [
        "{{hostenv}}"
      ],
      "path": [
        "Management",
        "v2",
        "organizations"
      ],
      "query": [
        {
          "key": "mode",
          "value": "{{mode}}"
        }
      ]
    },
    "description": "Required scopes: organization_read"
  },
  "response": [
  ]
}