Chilkat Online Tools

unicodeCpp / DocuSign Admin API / Returns user information.

Back to Collection Items

#include <CkHttpW.h>
#include <CkJsonObjectW.h>
#include <CkHttpResponseW.h>

void ChilkatSample(void)
    {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttpW http;
    bool success;

    CkJsonObjectW queryParams;
    queryParams.UpdateString(L"email",L"{{email}}");

    http.SetRequestHeader(L"Content-Type",L"application/json");
    // Adds the "Authorization: Bearer {{accessToken}}" header.
    http.put_AuthToken(L"{{accessToken}}");
    http.SetRequestHeader(L"Accept",L"application/json");

    CkHttpResponseW *resp = http.QuickRequestParams(L"GET",L"https://{{hostenv}}/Management/v2/organizations/{{organizationId}}/users/profile",queryParams);
    if (http.get_LastMethodSuccess() == false) {
        wprintf(L"%s\n",http.lastErrorText());
        return;
    }

    wprintf(L"%d\n",resp->get_StatusCode());
    wprintf(L"%s\n",resp->bodyStr());
    delete resp;
    }

Curl Command

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

Postman Collection Item JSON

{
  "name": "Returns user information.",
  "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/{{organizationId}}/users/profile?email={{email}}",
      "protocol": "https",
      "host": [
        "{{hostenv}}"
      ],
      "path": [
        "Management",
        "v2",
        "organizations",
        "{{organizationId}}",
        "users",
        "profile"
      ],
      "query": [
        {
          "key": "email",
          "value": "{{email}}"
        }
      ],
      "variable": [
        {
          "key": "organizationId",
          "value": "{{organizationId}}"
        }
      ]
    },
    "description": "Required scopes: user_read"
  },
  "response": [
  ]
}