Chilkat Online Tools

Ruby / DocuSign eSignature REST API / Put one branding logo.

Back to Collection Items

require 'chilkat'

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

http = Chilkat::CkHttp.new()

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

# The following JSON is sent in the request body.

# {}

json = Chilkat::CkJsonObject.new()

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

sbRequestBody = Chilkat::CkStringBuilder.new()
json.EmitSb(sbRequestBody)

# resp is a CkHttpResponse
resp = http.PTextSb("PUT","https://domain.com/v2.1/accounts/{{accountId}}/brands/{{brandId}}/logos/{{logoType}}",sbRequestBody,"utf-8","image/png",false,false)
if (http.get_LastMethodSuccess() == false)
    print http.lastErrorText() + "\n";
    exit
end

print resp.get_StatusCode().to_s() + "\n";
print resp.bodyStr() + "\n";

Curl Command

curl -X PUT
	-H "Accept: application/json"
	-H "Content-Type: image/png"
	-H "Authorization: Bearer {{accessToken}}"
	-d '{}'
https://domain.com/v2.1/accounts/{{accountId}}/brands/{{brandId}}/logos/{{logoType}}

Postman Collection Item JSON

{
  "name": "Put one branding logo.",
  "request": {
    "method": "PUT",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      },
      {
        "key": "Content-Type",
        "value": "image/png"
      },
      {
        "key": "Authorization",
        "value": "Bearer {{accessToken}}"
      }
    ],
    "body": {
      "mode": "raw",
      "raw": "{}"
    },
    "url": {
      "raw": "{{baseUrl}}/v2.1/accounts/{{accountId}}/brands/{{brandId}}/logos/{{logoType}}",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "v2.1",
        "accounts",
        "{{accountId}}",
        "brands",
        "{{brandId}}",
        "logos",
        "{{logoType}}"
      ],
      "variable": [
        {
          "key": "accountId",
          "value": "{{accountId}}",
          "type": "string"
        },
        {
          "key": "brandId",
          "value": "{{brandId}}",
          "type": "string"
        },
        {
          "key": "logoType",
          "value": "{{logoType}}",
          "type": "string"
        }
      ]
    }
  },
  "response": [
  ]
}