Remove from Collection
For the purpose of this test, we have created one note in a project, and added two subnotes to it:
Response: HTTP 200, application/json (Hide)
GET /projects/1/notes
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
[ { "id": 1, "class": "Note", "url_path": "\/projects\/1\/notes\/1", "name": "On project level", "comments_count": 0, "attachments": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "project_id": 1, "is_hidden_from_clients": false, "body": "This note is on project level", "body_formatted": "This note is on project level", "body_plain_text": "This note is on project level", "created_on": 1430164215, "created_by_id": 1, "updated_on": 1430164216, "updated_by_id": 1, "note_id": 0, "is_subnote": false, "subnotes_count": 2, "is_in_collection": true, "position": 0, "contributor_ids": [ 1 ] } ]
Lets move subpage #1 to the project level:
Response: HTTP 200, application/json (Hide)
PUT /projects/1/notes/2/move-to-project
Payload:
1 2 3
{ "project_id": 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
{ "single": { "id": 2, "class": "Note", "url_path": "\/projects\/1\/notes\/2", "name": "Subnote #1", "comments_count": 0, "attachments": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "project_id": 1, "is_hidden_from_clients": false, "body": "This note is the first subnote", "body_formatted": "This note is the first subnote", "body_plain_text": "This note is the first subnote", "created_on": 1430164215, "created_by_id": 1, "updated_on": 1430164216, "updated_by_id": 1, "note_id": 0, "is_subnote": false, "subnotes_count": 0, "is_in_collection": false, "position": 0, "contributor_ids": [ 1 ] }, "subscribers": [ 1 ], "comments": [], "subnotes": [] }
Response: HTTP 200, application/json (Hide)
GET /projects/1/notes
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
[ { "id": 2, "class": "Note", "url_path": "\/projects\/1\/notes\/2", "name": "Subnote #1", "comments_count": 0, "attachments": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "project_id": 1, "is_hidden_from_clients": false, "body": "This note is the first subnote", "body_formatted": "This note is the first subnote", "body_plain_text": "This note is the first subnote", "created_on": 1430164215, "created_by_id": 1, "updated_on": 1430164216, "updated_by_id": 1, "note_id": 0, "is_subnote": false, "subnotes_count": 0, "is_in_collection": false, "position": 0, "contributor_ids": [ 1 ] }, { "id": 1, "class": "Note", "url_path": "\/projects\/1\/notes\/1", "name": "On project level", "comments_count": 0, "attachments": [], "is_trashed": false, "trashed_on": null, "trashed_by_id": 0, "project_id": 1, "is_hidden_from_clients": false, "body": "This note is on project level", "body_formatted": "This note is on project level", "body_plain_text": "This note is on project level", "created_on": 1430164215, "created_by_id": 1, "updated_on": 1430164216, "updated_by_id": 1, "note_id": 0, "is_subnote": false, "subnotes_count": 1, "is_in_collection": true, "position": 1, "contributor_ids": [ 1 ] } ]