AttachmentInfo (REST API)
The AttachmentInfo entity describes an attachment in Autotask. Refer to the Overview section of this article to learn more about working with attachments in the Autotask REST API. For the SOAP API version of this entity, review AttachmentInfo (SOAP API).
IMPORTANT Attachment behavior in the API has changed. To avoid service disruption, review our Changes to Attachment entities article for important information about this recent update.
BEFORE YOU BEGIN This entity is unique. You can only query it. To create or delete attachments, you must use the child collection URL for each attachment type. You can also query by using a child collection URL.
NOTE You can refer to the Online Help to find root and child access URLs of the entity you wish to query. Refer to Finding resource and child access URLs of REST API entities for more information.
Entity details
Entity Name: | AttachmentInfo |
Entity Path: |
/atservicesrest/v1.0/AttachmentInfo |
Can Create: | |
Can Update: | |
Can Query: | |
Can Delete: | |
Can Have UDFs: |
Overview
When adding an attachment to an entity via the API, the attachment must be encoded as base64 binary data.
To ensure a consistent quality of service for all users, the API uses the following thresholds when processing attachments.
- The maximum attachment file size indicated in the Autotask Online Help does not apply to the API. The API size limit for individual attachment files is 6 to 7 MB, with a maximum of 10,000,000 bytes within a five-minute period. If your integration exceeds either of these limits, you'll receive an error message indicating condition. If the integration exceeds 10,000,000 bytes within a five-minute span, the API will also stop accepting attachment creation calls for five minutes.
NOTE The API size limit for individual attachments is less than the 10 MB limit for individual attachment files when working through the Autotask UI.
- Attachment types are limited to the file types allowed in Autotask. For more details, refer to Add attachments.
Attachments are external documents that are associated with one of the following entities. Attachments in Autotask can be documents uploaded to the server, file links, folder links, and URLs.
- Account
- Documents (REST only)
- Expenses
- Knowledgebase articles (REST only)
- Task
- Ticket
- Task or Ticket Note
- Time Entry
- Asset
- Asset Note
- Project
- Opportunity
The following parent entities support nested attachments. Nested attachments are a child attachment to a parent attachment, and both the parent and the child can be of the same entity type.
- Articles
- Companies
- Configuration Items
- Documents
- Opportunities
- Tasks
- Tickets
NOTE Attachments nested under note or time entry attachments are created via the parent entity URL using the parentAttachmentId. The nested attachment does not have visibility to the note or time entry, but it will reflect that the parent is an attachment with the supplied ID.
The following parent entities do not support nested attachments. For these parents, you cannot create attachments that have a parent attachment of the same type.
- Account
- Sales Order
- Expense Report
- Resource
- Account Note
- Contract Note
- Project
- Project Note
Attachments support create, delete, and query functions only. It is not possible to update an attachment.
When you query an attachment entity's fields, you'll see picklist results similar to the example below. The REST API uses the value and label fields to define what type of content is attached to the entity. The label field matches the content classifications shown within Autotask. For more information about attachment types, refer to Add attachments.
"picklistValues": [
{
"value": "FILE_LINK",
"label": "File Link",
"isDefaultValue": false,
"sortOrder": 1,
"parentValue": "",
"isActive": true,
"isSystem": true
},
{
"value": "FOLDER_LINK",
"label": "Folder Link",
"isDefaultValue": false,
"sortOrder": 2,
"parentValue": "",
"isActive": true,
"isSystem": true
},
{
"value": "URL",
"label": "URL",
"isDefaultValue": false,
"sortOrder": 3,
"parentValue": "",
"isActive": true,
"isSystem": true
},
{
"value": "FILE_ATTACHMENT",
"label": "Attachment",
"isDefaultValue": false,
"sortOrder": 4,
"parentValue": "",
"isActive": true,
"isSystem": true
}
],
Fields that cannot be queried
The following fields from this entity will return an error when queried.
- fileSize
Conditions and requirements
General
- Queries that specify IDs of entities with child data will return attachments associated with those children. For example, a query that specifies a ticketID value will return all attachments that are parented to that ticket, plus any attachments that are parented to child TicketNotes, TimeEntries, and Attachments.
- If your query supplies both an entityID and a parentID, the entityID will take precedence.
Contact impersonation validation rules for creating entities
- The API user security level has access to contact impersonation for attachments.
- Publish must always be ALL.
- Contacts can only create attachments for Tickets or Project/Task/Ticket Notes that they have created.
- The contact is active.
- The contact's account is active.
NOTE To retrieve a specific attachment of a resource, your query must specify the Attachment ID of the Attachments child endpoint or the appropriate <EntityName>Attachments endpoint (such as TicketAttachments, ResourceAttachments, and so forth). Refer to Retrieving an attachment of a resource for additional details.
Field definitions
The following table describes the standard Autotask fields for this entity. Refer to the following articles for more information about working with these fields:
- The entityInformation REST API call
- Making basic query calls to the REST API
- Advanced query features of the REST API
To learn how to query picklist endpoints, refer to Understanding picklists.
Notes
- For string datatypes, the number in parentheses ( ) indicates the maximum number of characters allowed.
- LT indicates Local Term.
- If this entity has child collections, they will appear in a Child collection access URLs or an Entity URLs and relationships drop-down in the Entity details section of this article.
- You can call the /query/count/ endpoint of a resource to determine how many records a collection holds.
Field Name | Datatype | Read-Only | Is Required | Reference Name | Picklist |
---|---|---|---|---|---|
articleID |
integer |
|
|
|
|
attachDate | datetime | ||||
attachedByContactID | long | Contacts | |||
attachedByResourceID | long | Resources | |||
attachmentType | string (30) |
||||
companyID |
integer |
|
|
|
|
companyNoteID |
integer |
|
|
|
|
contentType | string (100) |
||||
contractID |
integer |
|
|
|
|
contractNoteID |
integer |
|
|
|
|
creatorType |
integer |
|
|
|
|
documentID |
integer |
|
|
|
|
expenseReportID |
integer |
|
|
|
|
fileSize | long | ||||
fullPath | string (255) | ||||
id | long | ||||
impersonatorCreatorResourceID | integer | Resources |
|
||
installedProductID |
integer |
|
|
|
|
installedProductNoteID |
integer |
|
|
|
|
opportunityID | long | Opportunities | |||
parentAttachmentID |
integer |
|
|
Multiple; varies based on parent. |
|
parentID | long | ||||
parentType | integer | ||||
projectID |
integer |
|
|
|
|
projectNoteID |
integer |
|
|
|
|
publish | integer | ||||
resourceID |
integer |
|
|
|
|
salesOrderID |
integer |
|
|
|
|
taskID |
integer |
|
|
|
|
taskNoteID |
integer |
|
|
|
|
ticketID |
integer |
|
|
|
|
ticketNoteID |
integer |
|
|
|
|
timeEntryID |
integer |
|
|
|
|
title | string (255) |