Chilkat Online Tools

Foxpro / DocuSign Admin API / Returns user information.

Back to Collection Items

LOCAL loHttp
LOCAL lnSuccess
LOCAL loQueryParams
LOCAL loResp

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

loHttp = CreateObject('Chilkat_9_5_0.Http')

loQueryParams = CreateObject('Chilkat_9_5_0.JsonObject')
loQueryParams.UpdateString("email","{{email}}")

loHttp.SetRequestHeader("Content-Type","application/json")
* Adds the "Authorization: Bearer {{accessToken}}" header.
loHttp.AuthToken = "{{accessToken}}"
loHttp.SetRequestHeader("Accept","application/json")

loResp = loHttp.QuickRequestParams("GET","https://{{hostenv}}/Management/v2/organizations/{{organizationId}}/users/profile",loQueryParams)
IF (loHttp.LastMethodSuccess = 0) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loQueryParams
    CANCEL
ENDIF

? STR(loResp.StatusCode)
? loResp.BodyStr
RELEASE loResp

RELEASE loHttp
RELEASE loQueryParams

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": [
  ]
}