Chilkat Online Tools

Classic ASP / DocuSign Admin API / Remove users from a DSGroup

Back to Collection Items

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example assumes the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

set http = Server.CreateObject("Chilkat_9_5_0.Http")

' Use this online tool to generate code from sample JSON: Generate Code to Create JSON

' The following JSON is sent in the request body.

' {}

set json = Server.CreateObject("Chilkat_9_5_0.JsonObject")

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

set sbRequestBody = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = json.EmitSb(sbRequestBody)

' resp is a Chilkat_9_5_0.HttpResponse
Set resp = http.PTextSb("DELETE","https://{{hostenv}}/Management/v2.1/organizations/{{organizationId}}/accounts/{{accountId}}/dsgroups/{{dsGroupId}}/users",sbRequestBody,"utf-8","application/json",0,0)
If (http.LastMethodSuccess = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
    Response.End
End If

Response.Write "<pre>" & Server.HTMLEncode( resp.StatusCode) & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( resp.BodyStr) & "</pre>"


%>
</body>
</html>

Curl Command

curl -X DELETE
	-H "Accept: application/json"
	-H "Content-Type: application/json"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{}'
https://{{hostenv}}/Management/v2.1/organizations/{{organizationId}}/accounts/{{accountId}}/dsgroups/{{dsGroupId}}/users

Postman Collection Item JSON

{
  "name": "Remove users from a DSGroup",
  "request": {
    "method": "DELETE",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{}"
    },
    "url": {
      "raw": "https://{{hostenv}}/Management/v2.1/organizations/{{organizationId}}/accounts/{{accountId}}/dsgroups/{{dsGroupId}}/users",
      "protocol": "https",
      "host": [
        "{{hostenv}}"
      ],
      "path": [
        "Management",
        "v2.1",
        "organizations",
        "{{organizationId}}",
        "accounts",
        "{{accountId}}",
        "dsgroups",
        "{{dsGroupId}}",
        "users"
      ],
      "variable": [
        {
          "key": "organizationId",
          "value": "{{organizationId}}"
        },
        {
          "key": "accountId",
          "value": "{{accountId}}"
        },
        {
          "key": "dsGroupId",
          "value": "{{dsGroupId}}"
        }
      ]
    },
    "description": "Required scopes: user_write"
  },
  "response": [
  ]
}