Chilkat Online Tools

Delphi (DLL) / Zoho CRM REST APIs / Events

Back to Collection Items

var

begin
CkHttpRequest_putHttpVerb(req,'POST');CkHttpRequest_putPath(req,'/crm/v2/Events/{{record_id}}/Attachments');CkHttpRequest_putContentType(req,'multipart/form-data');success := CkHttpRequest_AddFileForUpload2(req,'file',' path to file','application/octet-stream');success := CkHttp_HttpSReq(http,'domain.com',443,True,req,resp);


Curl Command

curl -X POST
	-H "Authorization: Bearer <access_token>"
	--form 'file=@"/path/to/file"'
https://domain.com/crm/v2/Events/{{record_id}}/Attachments

Postman Collection Item JSON

{
  "name": "Events",
  "request": {
    "auth": {
      "type": "bearer",
      "bearer": [
        {
          "key": "token",
          "value": "{{access-token}}",
          "type": "string"
        }
      ]
    },
    "method": "POST",
    "header": [
    ],
    "body": {
      "mode": "formdata",
      "formdata": [
        {
          "key": "file",
          "type": "file",
          "src": "/Users/sneha-9300/Desktop/image.jpg"
        }
      ]
    },
    "url": {
      "raw": "{{api-domain}}/crm/v2/Events/{{record_id}}/Attachments",
      "host": [
        "{{api-domain}}"
      ],
      "path": [
        "crm",
        "v2",
        "Events",
        "{{record_id}}",
        "Attachments"
      ]
    },
    "description": "To attach a file to a record. You must include the attachment in the request with content type as multipart/form data."
  },
  "response": [
  ]
}