Chilkat Online Tools

Java / DocuSign Admin API / Get list of DSGroups

Back to Collection Items

import com.chilkatsoft.*;

public class ChilkatExample {

  static {
    try {
        System.loadLibrary("chilkat");
    } catch (UnsatisfiedLinkError e) {
      System.err.println("Native code library failed to load.\n" + e);
      System.exit(1);
    }
  }

  public static void main(String argv[])
  {
    // This example assumes the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    CkHttp http = new CkHttp();
    boolean success;

    CkJsonObject queryParams = new CkJsonObject();
    queryParams.UpdateString("page","{{page}}");
    queryParams.UpdateString("page_size","{{page_size}}");

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

    CkHttpResponse resp = http.QuickRequestParams("GET","https://{{hostenv}}/Management/v2.1/organizations/{{organizationId}}/accounts/{{accountId}}/dsgroups",queryParams);
    if (http.get_LastMethodSuccess() == false) {
        System.out.println(http.lastErrorText());
        return;
        }

    System.out.println(resp.get_StatusCode());
    System.out.println(resp.bodyStr());
  }
}

Curl Command

curl -G -d "page=%7B%7Bpage%7D%7D"
	-d "page_size=%7B%7Bpage_size%7D%7D"
	-H "Accept: application/json"
	-H "Content-Type: application/json"
	-H "Authorization: Bearer {{accessToken}}"
https://{{hostenv}}/Management/v2.1/organizations/{{organizationId}}/accounts/{{accountId}}/dsgroups

Postman Collection Item JSON

{
  "name": "Get list of DSGroups",
  "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.1/organizations/{{organizationId}}/accounts/{{accountId}}/dsgroups?page={{page}}&page_size={{page_size}}",
      "protocol": "https",
      "host": [
        "{{hostenv}}"
      ],
      "path": [
        "Management",
        "v2.1",
        "organizations",
        "{{organizationId}}",
        "accounts",
        "{{accountId}}",
        "dsgroups"
      ],
      "query": [
        {
          "key": "page",
          "value": "{{page}}"
        },
        {
          "key": "page_size",
          "value": "{{page_size}}"
        }
      ],
      "variable": [
        {
          "key": "organizationId",
          "value": "{{organizationId}}"
        },
        {
          "key": "accountId",
          "value": "{{accountId}}"
        }
      ]
    },
    "description": "Required scopes: user_read"
  },
  "response": [
  ]
}