Inbox Attachments

  1. Overview
  2. List Attachments
  3. Get a single Attachment
  4. Create a new attachment
  5. Update an attachment

Overview

This resource represents Inbox Attachments - the files (or images) that can be assigned to Inbox Messages.

Parameters

Name Type Read/Write Description
account Integer Read ID of Account the Attachment belongs to.
messages Array Read IDs of Messages the Attachment belongs to.
id Integer Read Attachment’s id.
url String Read Attachment’s url address.
name String Read Attachment’s name.
image_width Integer Read Attachment’s image width in pixels.
image_height Integer Read Attachment’s image height in pixels.
file_size Integer Read Attachment’s file size in bytes.
file_content_type String Read Attachment’s file content type.
created_at Time Read Attachment’s create time.
updated_at Time Read Attachment’s update time.
Name Type Read/Write Description Constraints
account Integer Read ID of Account the Attachment belongs to.  
messages Array Read IDs of Messages the Attachment belongs to.  
id Integer Read Attachment’s id.  
remote_file_url String Write Attachment’s remote url address. Must be a valid URL - use either this attribute or file
file String Write Attachment’s Base64 encoded file prepended with data:image/png;base64, (note comma separator between the type prefix and the Base64-encoded body) Must be less than: 10 megabytes, use either this attribute or remote_file_url
url String Read Attachment’s url address.  
name String Read/Write Attachment’s name.  
image_width Integer Read Attachment’s image width in pixels.  
image_height Integer Read Attachment’s image height in pixels.  
file_size Integer Read Attachment’s file size in bytes.  
file_content_type String Read Attachment’s file content type.  
created_at Time Read Attachment’s create time.  
updated_at Time Read Attachment’s update time.  

List Attachments

GET /inbox/attachments

Response

{
  "links": {
    "attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
    "attachments.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{attachments.messages}"
  },
  "attachments": [
    {
      "id": 1,
      "file_content_type": "text/plain",
      "file_size": 1400,
      "image_height": 480,
      "image_width": 120,
      "name": "example.jpg",
      "url": "/path/to/image/example",
      "created_at": "2018-12-19T12:58:53Z",
      "updated_at": "2018-12-19T12:58:53Z",
      "links": {
        "account": 1,
        "messages": [

        ]
      }
    }
  ],
  "meta": {
  }
}

Get a single Attachment

Returns a single attachment identified by ID.

GET /inbox/attachments/:attachment_id

Response

{
  "links": {
    "attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
    "attachments.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{attachments.messages}"
  },
  "attachments": [
    {
      "id": 1,
      "file_content_type": "text/plain",
      "file_size": 1400,
      "image_height": 480,
      "image_width": 120,
      "name": "example.jpg",
      "url": "/path/to/image/example",
      "created_at": "2018-12-19T12:58:53Z",
      "updated_at": "2018-12-19T12:58:53Z",
      "links": {
        "account": 1,
        "messages": [

        ]
      }
    }
  ],
  "meta": {
  }
}

Create a new attachment

Creates an attachment.

POST /inbox/attachments

Example JSON request

{
  "attachments": [
    {
      "file": "here goes encoded file",
      "name": "filename"
    }
  ]
}

Response

{
  "links": {
    "attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
    "attachments.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{attachments.messages}"
  },
  "attachments": [
    {
      "id": 1,
      "file_content_type": "text/plain",
      "file_size": 1000,
      "image_height": null,
      "image_width": null,
      "name": "filename",
      "url": "url/to/the/file",
      "created_at": "2018-12-19T12:58:53Z",
      "updated_at": "2018-12-19T12:58:53Z",
      "links": {
        "account": 1,
        "messages": [

        ]
      }
    }
  ],
  "meta": {
  }
}

Update an attachment

Returns an updated attachment identified by ID.

PUT /inbox/attachments/:id

Example JSON request

{
  "attachments": [
    {
      "file": "here goes encoded file",
      "name": "filename"
    }
  ]
}

Response

{
  "links": {
    "attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
    "attachments.messages": "https://www.bookingsync.com/api/v3/inbox/messages/{attachments.messages}"
  },
  "attachments": [
    {
      "id": 1,
      "file_content_type": "text/plain",
      "file_size": 1000,
      "image_height": null,
      "image_width": null,
      "name": "filename",
      "url": "url/to/the/file",
      "created_at": "2018-12-19T12:58:53Z",
      "updated_at": "2018-12-19T12:58:53Z",
      "links": {
        "account": 1,
        "messages": [

        ]
      }
    }
  ],
  "meta": {
  }
}