Task Management Attachments
Overview
This resource represents Task Attachments - files attached to Tasks, Task Comments, or Templates. Attachments can be images or documents uploaded via URL or Base64-encoded data.
Parameters
- OAuth Scopes:
- task_management_read
- task_management_write
| Name | Type | Read/Write | Description |
|---|---|---|---|
| account | Integer | Read | Account's ID related to Attachment |
| target | Object | Read | Polymorphic reference to target (Task, TaskComment, or Template) |
| created_by | Object | Read | Polymorphic reference to creator (User or Application) |
| id | UUID | Read | Attachment's ID |
| file | Object | Read | File object containing URLs for different sizes |
| created_at | Time | Read | Attachment's create time |
| updated_at | Time | Read | Attachment's update time |
| canceled_at | Time | Read | Attachment's cancellation time (null if not canceled) |
| Name | Type | Read/Write | Description | Constraints |
|---|---|---|---|---|
| account | Integer | Read | Account's ID related to Attachment | |
| target | Object | Read | Polymorphic reference to target (Task, TaskComment, or Template) | |
| created_by | Object | Read | Polymorphic reference to creator (User or Application) | |
| id | UUID | Read | Attachment's ID | |
| target_id | UUID | Write | Target's ID (Task, TaskComment, or Template) | Required |
| target_type | String | Write | Target's type | Required, one of: TaskManagement::Task, TaskManagement::TaskComment, TaskManagement::Template |
| remote_file | String | Write | Base64-encoded file data | Either remote_file or remote_file_url is Required |
| remote_file_url | String | Write | URL to download the file from | Either remote_file or remote_file_url is Required |
| file | Object | Read | File object containing URLs for different sizes | |
| created_at | Time | Read | Attachment's create time | |
| updated_at | Time | Read | Attachment's update time | |
| canceled_at | Time | Read | Attachment's cancellation time (null if not canceled) |
file Object
The file object in responses contains URLs for accessing the attachment:
| Name | Type | Description |
|---|---|---|
| thumbnail | String | URL to thumbnail version (72x48 pixels) |
| small | String | URL to small version (161x107 pixels) |
| original | String | URL to original file |
Image Processing
The thumbnail and small variants are only available for image files that support transformation (variable images). For non-image files or non-transformable images, these fields will be null.
List Attachments
GET /task_management/attachments
- OAuth Scopes:
- task_management_read / task_management_write
response.json
{
"links": {
"attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
"attachments.task": "https://www.bookingsync.com/api/v3/task_management/tasks/{attachments.target.id}",
"attachments.task_comment": "https://www.bookingsync.com/api/v3/task_management/task_comments/{attachments.target.id}",
"attachments.template": "https://www.bookingsync.com/api/v3/task_management/templates/{attachments.target.id}",
"attachments.user": "https://www.bookingsync.com/api/v3/users/{attachments.created_by.id}",
"attachments.application": "https://www.bookingsync.com/api/v3/applications/{attachments.created_by.id}"
},
"attachments": [
{
"links": {
"account": 1,
"target": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "TaskManagement::Task"
},
"created_by": {
"id": 5,
"type": "User"
}
},
"id": "e5f6a7b8-c9d0-1234-efgh-567890123456",
"file": {
"thumbnail": "https://storage.example.com/attachments/e5f6a7b8/thumbnail.jpg",
"small": "https://storage.example.com/attachments/e5f6a7b8/small.jpg",
"original": "https://storage.example.com/attachments/e5f6a7b8/original.jpg"
},
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z",
"canceled_at": null
}
],
"meta": {}
}
Get a single Attachment
Returns a single attachment identified by ID.
GET /task_management/attachments/:attachment_id
- OAuth Scopes:
- task_management_read / task_management_write
response.json
{
"links": {
"attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
"attachments.task": "https://www.bookingsync.com/api/v3/task_management/tasks/{attachments.target.id}",
"attachments.task_comment": "https://www.bookingsync.com/api/v3/task_management/task_comments/{attachments.target.id}",
"attachments.template": "https://www.bookingsync.com/api/v3/task_management/templates/{attachments.target.id}",
"attachments.user": "https://www.bookingsync.com/api/v3/users/{attachments.created_by.id}",
"attachments.application": "https://www.bookingsync.com/api/v3/applications/{attachments.created_by.id}"
},
"attachments": [
{
"links": {
"account": 1,
"target": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "TaskManagement::Task"
},
"created_by": {
"id": 5,
"type": "User"
}
},
"id": "e5f6a7b8-c9d0-1234-efgh-567890123456",
"file": {
"thumbnail": "https://storage.example.com/attachments/e5f6a7b8/thumbnail.jpg",
"small": "https://storage.example.com/attachments/e5f6a7b8/small.jpg",
"original": "https://storage.example.com/attachments/e5f6a7b8/original.jpg"
},
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z",
"canceled_at": null
}
],
"meta": {}
}
Create a new Attachment
Creates an Attachment.
POST /task_management/attachments
- OAuth Scopes:
- task_management_write
request.json
{
"attachments": [
{
"target_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"target_type": "TaskManagement::Task",
"remote_file_url": "https://example.com/images/photo.jpg"
}
]
}
response.json
{
"links": {
"attachments.account": "https://www.bookingsync.com/api/v3/accounts/{attachments.account}",
"attachments.task": "https://www.bookingsync.com/api/v3/task_management/tasks/{attachments.target.id}",
"attachments.task_comment": "https://www.bookingsync.com/api/v3/task_management/task_comments/{attachments.target.id}",
"attachments.template": "https://www.bookingsync.com/api/v3/task_management/templates/{attachments.target.id}",
"attachments.user": "https://www.bookingsync.com/api/v3/users/{attachments.created_by.id}",
"attachments.application": "https://www.bookingsync.com/api/v3/applications/{attachments.created_by.id}"
},
"attachments": [
{
"links": {
"account": 1,
"target": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"type": "TaskManagement::Task"
},
"created_by": {
"id": 5,
"type": "User"
}
},
"id": "e5f6a7b8-c9d0-1234-efgh-567890123456",
"file": {
"thumbnail": "https://storage.example.com/attachments/e5f6a7b8/thumbnail.jpg",
"small": "https://storage.example.com/attachments/e5f6a7b8/small.jpg",
"original": "https://storage.example.com/attachments/e5f6a7b8/original.jpg"
},
"created_at": "2024-01-15T11:00:00Z",
"updated_at": "2024-01-15T11:00:00Z",
"canceled_at": null
}
],
"meta": {}
}
File Upload Methods
You can upload files using one of two methods:
remote_file: Provide Base64-encoded file dataremote_file_url: Provide a URL from which the file will be downloaded
Only one method should be used per request.
Delete an Attachment
Cancels an Attachment (soft delete).
DELETE /task_management/attachments/:attachment_id
- OAuth Scopes:
- task_management_write
Returns an empty body with status 204 No Content.