Inbox Attachments
Overview
This resource represents Inbox Attachments - the files (or images) that can be assigned to Inbox Messages.
Parameters
- OAuth Scopes:
- inbox_read
- inbox_write
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 | Inbox Attachment's create time. |
updated_at | Time | Read | Inbox 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 | Inbox Attachment's create time. | |
updated_at | Time | Read | Inbox Attachment's update time. |
List Attachments
GET /inbox/attachments
- OAuth Scopes:
- inbox_read / inbox_write
response.json
{
"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": [
{
"links": {
"account": 1,
"messages": []
},
"created_at": "2018-12-19T12:58:53Z",
"file_content_type": "text/plain",
"file_size": 1400,
"id": 1,
"image_height": 480,
"image_width": 120,
"name": "example.jpg",
"updated_at": "2018-12-19T12:58:53Z",
"url": "/path/to/image/example"
}
],
"meta": {}
}
Get a single Attachment
Returns a single attachment identified by ID.
GET /inbox/attachments/:attachment_id
- OAuth Scopes:
- inbox_read / inbox_write
response.json
{
"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": [
{
"links": {
"account": 1,
"messages": []
},
"created_at": "2018-12-19T12:58:53Z",
"file_content_type": "text/plain",
"file_size": 1400,
"id": 1,
"image_height": 480,
"image_width": 120,
"name": "example.jpg",
"updated_at": "2018-12-19T12:58:53Z",
"url": "/path/to/image/example"
}
],
"meta": {}
}
Create a new attachment
Creates an attachment.
POST /inbox/attachments
- OAuth Scopes:
- inbox_write
request.json
{
"attachments": [
{
"name": "filename",
"file": "here goes encoded file"
}
]
}
response.json
{
"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": [
{
"links": {
"account": 1,
"messages": []
},
"created_at": "2018-12-19T12:58:53Z",
"file_content_type": "text/plain",
"file_size": 1000,
"id": 1,
"image_height": null,
"image_width": null,
"name": "filename",
"updated_at": "2018-12-19T12:58:53Z",
"url": "url/to/the/file"
}
],
"meta": {}
}
Update an attachment
Returns an updated attachment identified by ID.
PUT /inbox/attachments/:id
- OAuth Scopes:
- inbox_write
request.json
{
"attachments": [
{
"name": "filename",
"file": "here goes encoded file"
}
]
}
response.json
{
"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": [
{
"links": {
"account": 1,
"messages": []
},
"created_at": "2018-12-19T12:58:53Z",
"file_content_type": "text/plain",
"file_size": 1000,
"id": 1,
"image_height": null,
"image_width": null,
"name": "filename",
"updated_at": "2018-12-19T12:58:53Z",
"url": "url/to/the/file"
}
],
"meta": {}
}