Back to Collection Items
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
loHttp = createobject("CkHttp")
loReq = createobject("CkHttpRequest")
loReq.HttpVerb = "DELETE"
loReq.Path = "/crm/v2.1/Products/{{record_id}}/photo"
loReq.ContentType = "multipart/form-data"
llSuccess = loReq.AddFileForUpload2("file"," path to file","application/octet-stream")
loReq.AddHeader("Authorization","Bearer <access_token>")
loReq.AddHeader("Expect","100-continue")
loResp = loHttp.SynchronousRequest("domain.com",443,.T.,loReq)
if (loHttp.LastMethodSuccess = .F.) then
? loHttp.LastErrorText
release loHttp
release loReq
return
endif
? str(loResp.StatusCode)
? loResp.BodyStr
release loResp
release loHttp
release loReq
Curl Command
curl -X DELETE
-H "Authorization: Bearer <access_token>"
--form 'file=@"/path/to/file"'
https://domain.com/crm/v2.1/Products/{{record_id}}/photo
Postman Collection Item JSON
{
"name": "Products",
"request": {
"auth": {
"type": "bearer",
"bearer": [
{
"key": "token",
"value": "{{access-token}}",
"type": "string"
}
]
},
"method": "DELETE",
"header": [
],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "file",
"type": "file",
"src": "/Users/sneha-9300/Desktop/image.jpg"
}
]
},
"url": {
"raw": "{{api-domain}}/crm/v2.1/Products/{{record_id}}/photo",
"host": [
"{{api-domain}}"
],
"path": [
"crm",
"v2.1",
"Products",
"{{record_id}}",
"photo"
]
},
"description": "To delete a photo from a record in a module."
},
"response": [
]
}