Breadcrumbs

[Integrations] Update or Create an attachment

Update or create an attachment.

  • HTTP URL : https://<your-instance>.yooi.io/api/store/object/id/{objectId}/attachments/{attachmentFieldId}/{filename}?forceUpdate=true

  • HTTP method: POST

  • Parameters (request):

    • objectId : instance id

    • attachmentFieldId : field id

    • filename : name of the file

    • forceUpdate (optional parameter, false by default) : If a file with the same name already exists and this parameter is true, the existing file will be replaced.

  • Parameters (body):

    • file content

  • Header

    • Content-Type : file type

Example

Bash
 curl -X 'POST' \
  'https://<your-instance>.yooi.io/api/store/object/id/cc416276-73c4-4cb8-a090-d101422f36aa/attachments/51842f47-311c-47aa-90ea-947eb4722417/logo.jpg?forceUpdate=true' \
  -H 'Authorization: Bearer #yourtoken#'
  -H "Content-Type: image/jpeg"
  -d #fileContent#

Response

JSON
{
  "id": "cc416276-73c4-4cb8-a090-d101422f36aa",
  "key": "cc416276-73c4-4cb8-a090-d101422f36aa",
  "eventId": "1739447500951-0",
  "attachment": {
    "name": "logo.jpg",
    "revision": "0e995305-d0ea-4bca-99df-02185ef95406"
  }
}