Attachments API

Files can be uploaded to Aha! as a sub-resource on any resource that supports them. These resources support attachments:

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 record description via a link

POST/api/v1/notes/:note_id/attachments

Many records throughout Aha! have an associated description: features, requirements, ideas, etc. You can find the ID of a record's description within the description attribute returned by any record show endpoint. You can then use that description ID to create an attachment on the record by providing it as the note_id URL parameter for this endpoint.

Parameters
NameDescription
note_id *

Numeric ID of the record description for which the attachment should be created

Example request

POST/api/v1/notes/793547626/attachments

Example CURL command

curl "https://company.aha.io/api/v1/notes/793547626/attachments" -d 'attachment[file_url]=http%3A%2F%2Fwww.aha.io%2F&attachment[content_type]=text%2Fhtml&attachment[file_name]=home_page.html' -X POST \
	-H "Authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab" \
	-H "Content-Type: multipart/form-data" \
	-H "Accept: application/json"

Request

authorization: Bearer 15b60d42d4bc417284a246ced6877b0bf13fb4aca415f7b55f7006bc3694a8ab
contentType: multipart/form-data
accept: application/json

Request body

attachment[file_url]=http%3A%2F%2Fwww.aha.io%2F&attachment[content_type]=text%2Fhtml&attachment[file_name]=home_page.html

Response

Status: 200 OK
contentType: application/json; charset=utf-8

Response body

© 2020 Aha! Labs Inc.All rights reserved