Upload an attachment
POST
/tasks/{task_gid}/attachments
Attachments
record for the created attachment object. It is not possible to attach
files from third party services such as Dropbox, Box & Google Drive via
the API. You must download the file content first and then upload it as
any other attachment.
the full contents of the file to be uploaded.
terminators are of the form
CRLF
or \r\n
outlinedhere
in order for the server to reliably and properly handle the request.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://app.asana.com/api/1.0/tasks//attachments'
Response Response Example
200 - Example 1
{
"data": {
"gid": "12345",
"resource_type": "task",
"name": "Screenshot.png",
"resource_subtype": null,
"created_at": "2012-02-22T02:06:58.147Z",
"download_url": "https://s3.amazonaws.com/assets/123/Screenshot.png",
"host": "dropbox",
"parent": {
"gid": "12345",
"resource_type": "task",
"name": "Bug Task"
},
"view_url": "https://www.dropbox.com/s/123/Screenshot.png"
}
}
Request
Path Params
task_gid
string
required
Body Params multipart/form-data
file
file
optional
name
string
optional
resource_subtype
string
optional
asana_file_attachments
will be assumed.Example:
text
url
string
optional
Responses
Modified at 2022-09-13 02:00:31