Attachments API
Files can be uploaded to Aha! as a sub-resource on any resource that supports them. These resources support attachments:
- Record descriptions (the description of a feature, requirement, etc.)
- Comments
- To-dos
- Custom note fields
The format of an attachment is either a multipart/form-data
upload with
the input name attachment[data]
or a JSON payload pointing to an URL link:
{
"attachment": {
"file_url": "http://www.aha.io/",
"content_type": "text/html",
"file_name": "home_page.html"
}
}
Create an attachment on a to-do via a link
POST /api/v1/tasks/:task_id/attachments
Name | Description |
---|---|
task_id * | Numeric ID of the to-do for which the attachment should be created |
Example request
POST /api/v1/tasks/1041191038/attachments
Example CURL command
curl "https://company.aha.io/api/v1/tasks/1041191038/attachments" -d '------------XnJLe9ZIbbGUYtzPQJ16u1
content-disposition: form-data; name="attachment[file_url]"
http://www.aha.io/
------------XnJLe9ZIbbGUYtzPQJ16u1
content-disposition: form-data; name="attachment[content_type]"
text/html
------------XnJLe9ZIbbGUYtzPQJ16u1
content-disposition: form-data; name="attachment[file_name]"
home_page.html
------------XnJLe9ZIbbGUYtzPQJ16u1--
' -X POST \
-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
-H "Content-Type: multipart/form-data; boundary=----------XnJLe9ZIbbGUYtzPQJ16u1" \
-H "Accept: application/json"
Request
authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
contentType: multipart/form-data; boundary=----------XnJLe9ZIbbGUYtzPQJ16u1
accept: application/json
Request body
------------XnJLe9ZIbbGUYtzPQJ16u1 content-disposition: form-data; name="attachment[file_url]" http://www.aha.io/ ------------XnJLe9ZIbbGUYtzPQJ16u1 content-disposition: form-data; name="attachment[content_type]" text/html ------------XnJLe9ZIbbGUYtzPQJ16u1 content-disposition: form-data; name="attachment[file_name]" home_page.html ------------XnJLe9ZIbbGUYtzPQJ16u1--
Response
Status: 200 OK
contentType: application/json; charset=utf-8
Response body