Attachments are a way of associating a Document with a Task and can be used to fufill a File Request.
Name
Description
Methods
self
The URI of the Attachment.
GET
parent
The URI of the Task .
GET
delete
The URI to delete the Attachment.
DELETE
document
The URI to the attached Document .
GET
GET /tasks/12345/attachments/23 HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"actors" : [{
"name" : " Jimmy Snake" ,
"email" : " [email protected] " ,
"rel" : " attacher" ,
"links" : [
{ "rel" : " self" , "href" : " .." },
{ "rel" : " avatar" , "href" : " .." , "type" : " image/jpeg" },
{ "rel" : " alternate" , "href" : " .." , "type" : " text/html" }
]
}],
"created" : " Thu, 15 Sep 2016 12:38:28 GMT" ,
"links" : [
{ "rel" : " self" , "href" : " ..." },
{ "rel" : " parent" , "href" : " ..." },
{ "rel" : " delete" , "href" : " ..." },
{ "rel" : " document" , "href" : " ..." }
]
}
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<attachment >
<actor name =" Peter Gibson" email =" [email protected] " rel =" attacher" >
<link rel =" self" href =" ..." />
<link rel =" avatar" href =" ..." type =" image/jpeg" />
<link rel =" alternate" href =" ..." type =" text/html" />
</actor >
<created >2007-10-10T09:02:17Z</created >
<link rel =" self" href =" ..." />
<link rel =" parent" href =" ..." />
<link rel =" delete" href =" ..." />
<link rel =" document" href =" ..." />
</attachment >
Case
Response Code
Error Code
Attachment does not exist
404 Not Found
AttachmentNotFound
Task does not exist
404 Not Found
TaskNotFound
Task is deleted
404 Not Found
TaskDeleted
User is not a member of the Workspace
403 Forbidden
WorkspaceMembershipRequired
Workspace is locked
403 Forbidden
WorkspaceLocked
Workspace is deleted
404 Not Found
WorkspaceDeleted
Retrieve all attachments on a task
This is limited to your 500 most recent attachments.
Name
Description
Methods
self
The URI of the Attachments on the Task.
GET
parent
The URI of the Task .
GET
create
The URI to add an Attachment to the Task.
POST
GET /tasks/12345/attachments HTTP/1.1
Accept: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+json
{
"links" : [
{ "rel" : " self" , "href" : " ..." },
{ "rel" : " parent" , "href" : " ..." },
{ "rel" : " create" , "href" : " ..." }
],
"attachments" : [{
"links" : [
{ "rel" : " self" , "href" : " ..." },
... other attachment links ...
],
... other attachment elements ...
}]
}
HTTP/1.1 200 OK
Content-Type: application/vnd.huddle.data+xml
<attachments >
<link rel =" self" href =" .." />
<link rel =" parent" href =" .." />
<link rel =" create" href =" .." />
<items >
<attachment >
<link rel =" self" href =" ..." />
... other attachment elements ...
</attachment >
</items >
</attachments >
Case
Response Code
Error Code
Task does not exist
404 Not Found
TaskNotFound
Task is deleted
404 Not Found
TaskDeleted
User is not a member of the Workspace
403 Forbidden
WorkspaceMembershipRequired
Workspace is locked
403 Forbidden
WorkspaceLocked
Workspace is deleted
404 Not Found
WorkspaceDeleted
Attach documents to a task
POST /tasks/12345/attachments HTTP/1.1
Content-Type: application/vnd.huddle.data+json
Authorization: OAuth2 frootymcnooty/vonbootycherooty
[{
"links" :
[{
"href" : " ..." ,
"rel" : " document"
}]
},{
"links" :
[{
"href" : " ..." ,
"rel" : " document"
}]
}]
POST /tasks/12345/attachments HTTP/1.1
Content-Type: application/vnd.huddle.data+xml
Authorization: OAuth2 frootymcnooty/vonbootycherooty
<attachments >
<attachment >
<link rel =" document" href =" .." />
</attachment >
<attachment >
<link rel =" document" href =" .." />
</attachment >
</attachments >
If successful, this method will return an empty response with a Created status code and a Location
header containing the URI of the Attachments collection.
This response uses the standard error codes and returns standard response headers .
HTTP/1.1 201 Created
Location: /tasks/12345/attachments
Case
Response Code
Error Code
Task does not exist
404 Not Found
TaskNotFound
Task is deleted
404 Not Found
TaskDeleted
Not a Document URI
400 Bad Request
Invalid
User is not a member of the Workspace
403 Forbidden
WorkspaceMembershipRequired
Workspace is locked
403 Forbidden
WorkspaceLocked
Workspace is archived
403 Forbidden
WorkspaceArchived
Workspace is deleted
404 Not Found
WorkspaceDeleted
DELETE /tasks/12345/attachments/23 HTTP/1.1
Authorization: OAuth2 frootymcnooty/vonbootycherooty
If successful, this method will return an empty response with a No Content status code.
This response uses the standard error codes and returns standard response headers .
Case
Response Code
Error Code
Attachment does not exist
404 Not Found
AttachmentNotFound
Task does not exist
404 Not Found
TaskNotFound
User is not a member of the Workspace
403 Forbidden
WorkspaceMembershipRequired
Workspace is locked
403 Forbidden
WorkspaceLocked
Workspace is archived
403 Forbidden
WorkspaceArchived
Workspace is deleted
404 Not Found
WorkspaceDeleted