Back to Collection Items
; This example assumes the Chilkat API to have been previously unlocked.
; See Global Unlock Sample for sample code.
$oHttp = ObjCreate("Chilkat.Http")
Local $bSuccess
; Use this online tool to generate code from sample JSON: Generate Code to Create JSON
; The following JSON is sent in the request body.
; {}
$oJson = ObjCreate("Chilkat.JsonObject")
$oHttp.SetRequestHeader "Content-Type","image/png"
; Adds the "Authorization: Bearer {{accessToken}}" header.
$oHttp.AuthToken = "{{accessToken}}"
$oHttp.SetRequestHeader "Accept","application/json"
$oSbRequestBody = ObjCreate("Chilkat.StringBuilder")
$oJson.EmitSb($oSbRequestBody)
Local $oResp = $oHttp.PTextSb("PUT","https://domain.com/v2.1/accounts/{{accountId}}/brands/{{brandId}}/logos/{{logoType}}",$oSbRequestBody,"utf-8","image/png",False,False)
If ($oHttp.LastMethodSuccess = False) Then
ConsoleWrite($oHttp.LastErrorText & @CRLF)
Exit
EndIf
ConsoleWrite($oResp.StatusCode & @CRLF)
ConsoleWrite($oResp.BodyStr & @CRLF)
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}}"
},
{
"key": "brandId",
"value": "{{brandId}}"
},
{
"key": "logoType",
"value": "{{logoType}}"
}
]
}
},
"response": [
]
}