Chilkat Online Tools

Node.js / DocuSign Admin API / Returns information about the users in the organization

Back to Collection Items

var os = require('os');
if (os.platform() == 'win32') {  
    if (os.arch() == 'ia32') {
        var chilkat = require('@chilkat/ck-node21-win-ia32');
    } else {
        var chilkat = require('@chilkat/ck-node21-win64'); 
    }
} else if (os.platform() == 'linux') {
    if (os.arch() == 'arm') {
        var chilkat = require('@chilkat/ck-node21-arm');
    } else if (os.arch() == 'x86') {
        var chilkat = require('@chilkat/ck-node21-linux32');
    } else {
        var chilkat = require('@chilkat/ck-node21-linux64');
    }
} else if (os.platform() == 'darwin') {
    if (os.arch() == 'arm64') {
        var chilkat = require('@chilkat/ck-node21-mac-m1');
    } else {
        var chilkat = require('@chilkat/ck-node21-macosx');
    }
}


function chilkatExample() {

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

    var http = new chilkat.Http();
    var success;

    var queryParams = new chilkat.JsonObject();
    queryParams.UpdateString("start","{{start}}");
    queryParams.UpdateString("take","{{take}}");
    queryParams.UpdateString("end","{{end}}");
    queryParams.UpdateString("email","{{email}}");
    queryParams.UpdateString("email_user_name_like","{{email_user_name_like}}");
    queryParams.UpdateString("status","{{status}}");
    queryParams.UpdateString("membership_status","{{membership_status}}");
    queryParams.UpdateString("account_id","{{account_id}}");
    queryParams.UpdateString("organization_reserved_domain_id","{{organization_reserved_domain_id}}");
    queryParams.UpdateString("last_modified_since","{{last_modified_since}}");

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

    // resp: HttpResponse
    var resp = http.QuickRequestParams("GET","https://{{hostenv}}/Management/v2/organizations/{{organizationId}}/users",queryParams);
    if (http.LastMethodSuccess == false) {
        console.log(http.LastErrorText);
        return;
    }

    console.log(resp.StatusCode);
    console.log(resp.BodyStr);


}

chilkatExample();

Curl Command

curl -G -d "start=%7B%7Bstart%7D%7D"
	-d "take=%7B%7Btake%7D%7D"
	-d "end=%7B%7Bend%7D%7D"
	-d "email=%7B%7Bemail%7D%7D"
	-d "email_user_name_like=%7B%7Bemail_user_name_like%7D%7D"
	-d "status=%7B%7Bstatus%7D%7D"
	-d "membership_status=%7B%7Bmembership_status%7D%7D"
	-d "account_id=%7B%7Baccount_id%7D%7D"
	-d "organization_reserved_domain_id=%7B%7Borganization_reserved_domain_id%7D%7D"
	-d "last_modified_since=%7B%7Blast_modified_since%7D%7D"
	-H "Accept: application/json"
	-H "Content-Type: application/json"
	-H "Authorization: Bearer {{accessToken}}"
https://{{hostenv}}/Management/v2/organizations/{{organizationId}}/users

Postman Collection Item JSON

{
  "name": "Returns information about the users in the organization",
  "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?start={{start}}&take={{take}}&end={{end}}&email={{email}}&email_user_name_like={{email_user_name_like}}&status={{status}}&membership_status={{membership_status}}&account_id={{account_id}}&organization_reserved_domain_id={{organization_reserved_domain_id}}&last_modified_since={{last_modified_since}}",
      "protocol": "https",
      "host": [
        "{{hostenv}}"
      ],
      "path": [
        "Management",
        "v2",
        "organizations",
        "{{organizationId}}",
        "users"
      ],
      "query": [
        {
          "key": "start",
          "value": "{{start}}"
        },
        {
          "key": "take",
          "value": "{{take}}"
        },
        {
          "key": "end",
          "value": "{{end}}"
        },
        {
          "key": "email",
          "value": "{{email}}"
        },
        {
          "key": "email_user_name_like",
          "value": "{{email_user_name_like}}"
        },
        {
          "key": "status",
          "value": "{{status}}"
        },
        {
          "key": "membership_status",
          "value": "{{membership_status}}"
        },
        {
          "key": "account_id",
          "value": "{{account_id}}"
        },
        {
          "key": "organization_reserved_domain_id",
          "value": "{{organization_reserved_domain_id}}"
        },
        {
          "key": "last_modified_since",
          "value": "{{last_modified_since}}"
        }
      ],
      "variable": [
        {
          "key": "organizationId",
          "value": "{{organizationId}}"
        }
      ]
    },
    "description": "Required scopes: user_read"
  },
  "response": [
  ]
}