Chilkat Online Tools

Java / DocuSign Admin API / Returns the list of groups in an account.

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("start","{{start}}");
    queryParams.UpdateString("take","{{take}}");
    queryParams.UpdateString("end","{{end}}");

    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/organizations/{{organizationId}}/accounts/{{accountId}}/groups",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 "start=%7B%7Bstart%7D%7D"
	-d "take=%7B%7Btake%7D%7D"
	-d "end=%7B%7Bend%7D%7D"
	-H "Accept: application/json"
	-H "Content-Type: application/json"
	-H "Authorization: Bearer {{accessToken}}"
https://{{hostenv}}/Management/v2/organizations/{{organizationId}}/accounts/{{accountId}}/groups

Postman Collection Item JSON

{
  "name": "Returns the list of groups in an account.",
  "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}}/accounts/{{accountId}}/groups?start={{start}}&take={{take}}&end={{end}}",
      "protocol": "https",
      "host": [
        "{{hostenv}}"
      ],
      "path": [
        "Management",
        "v2",
        "organizations",
        "{{organizationId}}",
        "accounts",
        "{{accountId}}",
        "groups"
      ],
      "query": [
        {
          "key": "start",
          "value": "{{start}}"
        },
        {
          "key": "take",
          "value": "{{take}}"
        },
        {
          "key": "end",
          "value": "{{end}}"
        }
      ],
      "variable": [
        {
          "key": "organizationId",
          "value": "{{organizationId}}"
        },
        {
          "key": "accountId",
          "value": "{{accountId}}"
        }
      ]
    },
    "description": "Required scopes: group_read"
  },
  "response": [
  ]
}