Reodering
Lets reorder notes in the first project:
Response: HTTP 200, text/html
PUT /projects/1/notes/reorder
Payload:
1 2 3 4
[
2,
1
]Now, lets reorder sub-notes in the first note:
Response: HTTP 200, application/json (Hide)
PUT /projects/1/notes/1/reorder
Payload:
1 2 3 4 5
[
1,
4,
3
]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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
{
"single": {
"id": 1,
"class": "Note",
"url_path": "\/projects\/1\/notes\/1",
"name": "First Document",
"comments_count": 0,
"attachments": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"project_id": 1,
"is_hidden_from_clients": false,
"body": "First document",
"body_formatted": "First document",
"body_plain_text": "First document",
"created_on": 1430164223,
"created_by_id": 1,
"updated_on": 1430164224,
"updated_by_id": 1,
"note_id": 0,
"is_subnote": false,
"subnotes_count": 2,
"is_in_collection": true,
"position": 2,
"contributor_ids": [
1
]
},
"subscribers": [
1
],
"comments": [],
"subnotes": [
{
"id": 4,
"class": "Note",
"url_path": "\/projects\/1\/notes\/4",
"name": "Second Subpage",
"comments_count": 0,
"attachments": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"project_id": 1,
"is_hidden_from_clients": false,
"body": "Second subpage",
"body_formatted": "Second subpage",
"body_plain_text": "Second subpage",
"created_on": 1430164224,
"created_by_id": 1,
"updated_on": 1430164224,
"updated_by_id": 1,
"note_id": 1,
"is_subnote": true,
"subnotes_count": 0,
"is_in_collection": true,
"position": 1,
"contributor_ids": [
1
]
},
{
"id": 3,
"class": "Note",
"url_path": "\/projects\/1\/notes\/3",
"name": "First Subpage Title",
"comments_count": 0,
"attachments": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"project_id": 1,
"is_hidden_from_clients": false,
"body": "First subpage body",
"body_formatted": "First subpage body",
"body_plain_text": "First subpage body",
"created_on": 1430164224,
"created_by_id": 1,
"updated_on": 1430164224,
"updated_by_id": 1,
"note_id": 1,
"is_subnote": true,
"subnotes_count": 0,
"is_in_collection": true,
"position": 2,
"contributor_ids": [
1
]
}
]
}In this example, we only reordered sub-notes. If we reorder subpages in such a way that main page is no longer first in the list, one of the subpages will be promoted to the main page, and main page will be converted to a subpage:
Response: HTTP 200, application/json (Hide)
PUT /projects/1/notes/1/reorder
Payload:
1 2 3 4 5
[
4,
3,
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 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
{
"single": {
"id": 4,
"class": "Note",
"url_path": "\/projects\/1\/notes\/4",
"name": "Second Subpage",
"comments_count": 0,
"attachments": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"project_id": 1,
"is_hidden_from_clients": false,
"body": "Second subpage",
"body_formatted": "Second subpage",
"body_plain_text": "Second subpage",
"created_on": 1430164224,
"created_by_id": 1,
"updated_on": 1430164226,
"updated_by_id": 1,
"note_id": 0,
"is_subnote": false,
"subnotes_count": 2,
"is_in_collection": true,
"position": 2,
"contributor_ids": [
1
]
},
"subscribers": [
1
],
"comments": [],
"subnotes": [
{
"id": 3,
"class": "Note",
"url_path": "\/projects\/1\/notes\/3",
"name": "First Subpage Title",
"comments_count": 0,
"attachments": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"project_id": 1,
"is_hidden_from_clients": false,
"body": "First subpage body",
"body_formatted": "First subpage body",
"body_plain_text": "First subpage body",
"created_on": 1430164224,
"created_by_id": 1,
"updated_on": 1430164226,
"updated_by_id": 1,
"note_id": 4,
"is_subnote": true,
"subnotes_count": 0,
"is_in_collection": true,
"position": 1,
"contributor_ids": [
1
]
},
{
"id": 1,
"class": "Note",
"url_path": "\/projects\/1\/notes\/1",
"name": "First Document",
"comments_count": 0,
"attachments": [],
"is_trashed": false,
"trashed_on": null,
"trashed_by_id": 0,
"project_id": 1,
"is_hidden_from_clients": false,
"body": "First document",
"body_formatted": "First document",
"body_plain_text": "First document",
"created_on": 1430164223,
"created_by_id": 1,
"updated_on": 1430164226,
"updated_by_id": 1,
"note_id": 4,
"is_subnote": true,
"subnotes_count": 0,
"is_in_collection": true,
"position": 2,
"contributor_ids": [
1
]
}
]
}