Chilkat Online Tools

Powershell / DocuSign eSignature REST API / Deletes one or more brand profiles.

Back to Collection Items

Add-Type -Path "C:\chilkat\ChilkatDotNet47-9.5.0-x64\ChilkatDotNet47.dll"

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

$http = New-Object Chilkat.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.

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

$json = New-Object Chilkat.JsonObject
$json.UpdateString("brands[0].brandId","sample string 1")

# Adds the "Authorization: Bearer {{accessToken}}" header.
$http.AuthToken = "{{accessToken}}"
$http.SetRequestHeader("Accept","application/json")

$sbRequestBody = New-Object Chilkat.StringBuilder
$json.EmitSb($sbRequestBody)

$resp = $http.PTextSb("DELETE","https://domain.com/v2.1/accounts/{{accountId}}/brands",$sbRequestBody,"utf-8","application/json",$false,$false)
if ($http.LastMethodSuccess -eq $false) {
    $($http.LastErrorText)
    exit
}

$($resp.StatusCode)
$($resp.BodyStr)

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}}",
          "type": "string"
        }
      ]
    },
    "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": [
  ]
}