Inbox Attachments

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

Parameters

Name Type Read/Write Description
id Integer Read Attachment’s id.
account_id Integer Read Id of Account Attachment belongs to.
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
id Integer Read Attachment’s id.
account_id Integer Read Id of Account Attachment belongs to.
remote_file_url String Write Attachment’s remote url address.
file String Write Attachment’s Base64 encoded file.
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": {
  }
}