Attachments
Response: HTTP 200, application/json (Hide)
POST /upload-files
Files:
1 2 3 4 5 6
[ [ "ac.png", "image\/png" ] ]
Response:
1 2 3 4 5 6 7 8 9
[ { "code": "FVz6RyPOo4mwh4NUVxoPLjg0tcHuBQt8AS2ggGVv", "name": "ac.png", "mime_type": "image\/png", "size": 1927, "thumbnail_url": "http:\/\/feather.dev\/proxy.php?proxy=forward_thumbnail&module=system&v=current&b=DEV&context=upload&name=2015-04%2FECHioEl3EL0fLzz7V92nIhpQqN3VE6o7Bxj7Iazj&original_file_name=ac.png&width=--WIDTH--&height=--HEIGHT--&ver=1927&scale=--SCALE--" } ]
Response: HTTP 200, application/json (Hide)
POST /projects/1/tasks
Payload:
1 2 3 4 5 6
{ "name": "Task #1", "attach_uploaded_files": [ "FVz6RyPOo4mwh4NUVxoPLjg0tcHuBQt8AS2ggGVv" ] }
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
{ "single": { "id": 1, "class": "Task", "url_path": "\/projects\/1\/tasks\/1", "name": "Task #1", "assignee_id": 0, "delegated_by_id": 0, "completed_on": null, "completed_by_id": null, "is_completed": false, "comments_count": 0, "attachments": [ { "id": 1, "name": "ac.png", "mime_type": "image\/png", "size": 1927, "disposition": "attachment", "thumbnail_url": "http:\/\/feather.dev\/proxy.php?proxy=forward_thumbnail&module=system&v=current&b=DEV&context=upload&name=2015-04%2FECHioEl3EL0fLzz7V92nIhpQqN3VE6o7Bxj7Iazj&original_file_name=ac.png&width=--WIDTH--&height=--HEIGHT--&ver=1927&scale=--SCALE--" } ], "labels": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "project_id": 1, "is_hidden_from_clients": false, "body": "", "body_formatted": "", "created_on": 1430164308, "created_by_id": 1, "updated_on": 1430164308, "updated_by_id": 1, "task_number": 1, "task_list_id": 0, "position": 1, "is_important": false, "due_on": null, "estimate": 0, "job_type_id": 0, "total_subtasks": 0, "completed_subtasks": 0, "open_subtasks": 0 }, "subscribers": [ 1 ], "comments": [], "reminders": [], "subtasks": [], "task_list": null, "tracked_time": 0, "tracked_expenses": 0 }
Response: HTTP 200, application/json (Hide)
GET /attachments/1
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
{ "single": { "id": 1, "class": "Attachment", "url_path": "\/attachments\/1", "name": "ac.png", "parent_type": "Task", "parent_id": 1, "mime_type": "image\/png", "size": 1927, "md5": "1e3cd308a17a60b22c61493dcb3af0b0", "download_url": "http:\/\/feather.dev\/attachments\/1\/download", "thumbnail_url": "http:\/\/feather.dev\/proxy.php?proxy=forward_thumbnail&module=system&v=current&b=DEV&context=upload&name=2015-04%2FECHioEl3EL0fLzz7V92nIhpQqN3VE6o7Bxj7Iazj&original_file_name=ac.png&width=--WIDTH--&height=--HEIGHT--&ver=1927&scale=--SCALE--", "file_meta": { "kind": "image", "dimensions": { "width": 50, "height": 50 } }, "created_on": 1430164308, "created_by_id": 1, "disposition": "attachment", "project_id": 1, "is_hidden_from_clients": false }, "parent": { "id": 1, "class": "Task", "url_path": "\/projects\/1\/tasks\/1", "name": "Task #1", "assignee_id": 0, "delegated_by_id": 0, "completed_on": null, "completed_by_id": null, "is_completed": false, "comments_count": 0, "attachments": [ { "id": 1, "name": "ac.png", "mime_type": "image\/png", "size": 1927, "disposition": "attachment", "thumbnail_url": "http:\/\/feather.dev\/proxy.php?proxy=forward_thumbnail&module=system&v=current&b=DEV&context=upload&name=2015-04%2FECHioEl3EL0fLzz7V92nIhpQqN3VE6o7Bxj7Iazj&original_file_name=ac.png&width=--WIDTH--&height=--HEIGHT--&ver=1927&scale=--SCALE--" } ], "labels": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "project_id": 1, "is_hidden_from_clients": false, "body": "", "body_formatted": "", "created_on": 1430164308, "created_by_id": 1, "updated_on": 1430164308, "updated_by_id": 1, "task_number": 1, "task_list_id": 0, "position": 1, "is_important": false, "due_on": null, "estimate": 0, "job_type_id": 0, "total_subtasks": 0, "completed_subtasks": 0, "open_subtasks": 0 } }
Lets download the content:
Response: HTTP 200, image/png (Hide)
GET /attachments/1/download
Response:
1 2 3 4 5 6 7 8 9 10
PNG IHDR 2 2 ? tEXtSoftware Adobe ImageReadyqe< )IDATxZyli}L[F[JQMLA$D+B HlD"%D68"cT"QmSc(Lf~ᛯsmI_My>Rm ǏQpoaPa_C:gg4?I@Hۚ)oh4-< al (i [bo:B&ȏl4` l87 1եRR[v<}zE]cqS^ѽ;!n}y9ŨC۷z9 PyĵqH] '"<=OkjkQ *sr`:q.1h2":t@ʢEh?{623!5ڳdBիx}0*nq)(385w@y۴ {/ƍx'lnߎ0 g;Pr 6l@MIhHH=5qH;yR@TUʕ(:vL+&s.] sv'vMh0b?$Q-^zͅ.(hpdjhz:tG/nFDgϣJU~>ݿ:Ʋ1.mG^]L7:~<2$^(rJu5"320v,xZ)ܻ֮(CQq%d]< n?Lf[MűIܾ#"s~ \H7[TV{nGj/"wj / 4]H*!3VZ$.@w ]^2>riӧ3gC.Sb4{3y]u@<H7Q+@Сl>7kǘ֊-3CW}}>Z! h !;wA^ͥ.mG}ѩSCrcׄ#ùе8=#"ͽױÖHTl^B`fx {Pc^ N0#ƶm!19RͰۗ:]nn# *h'5*:.割i&qӖBڢEi"%E6nUOLɠ^k=^B-Z+k%ΆkjBMCbI5Me}l[V4:@Mnl¨!_/Q,$k֠FsXo*Dwj|~t'mD\\Haw6MqXow6t#qz7ԑqa@|>*0~ Ď*bU#Y$C Y?+eY&U4 āBozطr1t&#טIyl9`ϜǏ#+ԩ0 Ne:~@šRɛ_$X^F!o 1H7AY3YEudL!K Or25)A/Va XXȴϓuTp:ꊅ"9ܽnZz( oMc᳘{e|xw)F,3IÇhG&11kf⨛CΥ*/^DUqj+4&&,ky x5x#ү~fv3g"p-B/jb~#fOϞE.wgI:[Ș?=EBf&BdC@YYȣGM nEDKEE cI4I,1]@$U߫ c86Iw6^LK{^- ^9tX;m&25) 1*ַ_IdVkh}5 R! -+4Ss;j ӗ~I`(Ohx7/>[I_ ςܥ IENDB`
In order to delete an individual attachment, we can send a DELETE request to the attachment URL:
Response: HTTP 200, text/html
DELETE /attachments/1
Here's a confirmation that the attachment was actually deleted:
Response: HTTP 200, application/json (Hide)
GET /projects/1/tasks/1
Response:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
{ "single": { "id": 1, "class": "Task", "url_path": "\/projects\/1\/tasks\/1", "name": "Task #1", "assignee_id": 0, "delegated_by_id": 0, "completed_on": null, "completed_by_id": null, "is_completed": false, "comments_count": 0, "attachments": [], "labels": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "project_id": 1, "is_hidden_from_clients": false, "body": "", "body_formatted": "", "created_on": 1430164308, "created_by_id": 1, "updated_on": 1430164309, "updated_by_id": 1, "task_number": 1, "task_list_id": 0, "position": 1, "is_important": false, "due_on": null, "estimate": 0, "job_type_id": 0, "total_subtasks": 0, "completed_subtasks": 0, "open_subtasks": 0 }, "subscribers": [ 1 ], "comments": [], "reminders": [], "subtasks": [], "task_list": null, "tracked_time": 0, "tracked_expenses": 0 }