Chilkat Online Tools

TCL / DocuSign REST API / Deletes one or more brand profiles.

Back to Collection Items

load ./chilkat.dll

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

set http [new_CkHttp]

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

# The following JSON is sent in the request body.

# {
#   "brands": [
#     {
#       "brandId": "sample string 1"
#     }
#   ]
# }

set json [new_CkJsonObject]

CkJsonObject_UpdateString $json "brands[0].brandId" "sample string 1"

# Adds the "Authorization: Bearer {{accessToken}}" header.
CkHttp_put_AuthToken $http "{{accessToken}}"
CkHttp_SetRequestHeader $http "Accept" "application/json"

set sbRequestBody [new_CkStringBuilder]

CkJsonObject_EmitSb $json $sbRequestBody

# resp is a CkHttpResponse
set resp [CkHttp_PTextSb $http "DELETE" "https://domain.com/v2.1/accounts/{{accountId}}/brands" $sbRequestBody "utf-8" "application/json" 0 0]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    delete_CkJsonObject $json
    delete_CkStringBuilder $sbRequestBody
    exit
}

puts [CkHttpResponse_get_StatusCode $resp]
puts [CkHttpResponse_bodyStr $resp]
delete_CkHttpResponse $resp


delete_CkHttp $http
delete_CkJsonObject $json
delete_CkStringBuilder $sbRequestBody

Curl Command

curl -X DELETE
	-H "Accept: application/json"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{
  "brands": [
    {
      "brandId": "sample string 1"
    }
  ]
}'
https://domain.com/v2.1/accounts/{{accountId}}/brands

Postman Collection Item JSON

{
  "name": "Deletes one or more brand profiles.",
  "request": {
    "method": "DELETE",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{\n  \"brands\": [\n    {\n      \"brandId\": \"sample string 1\"\n    }\n  ]\n}"
    },
    "url": {
      "raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/brands",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2.1",
        "accounts",
        "{{accountId}}",
        "brands"
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "{{accountId}}"
        }
      ]
    },
    "description": "Deletes one or more brand profiles from an account. The Account Branding feature (accountSettings properties `canSelfBrandSend` and `canSelfBrandSend`) must be set to **true** to use this call."
  },
  "response": [
  ]
}