Move

For the purpose of this test, we have create a project and we'll add following pages to it:

  1. Note without subnotes,
  2. Note with a couple of subnotes,
  3. Note where we'll move the first two notes.
Response: HTTP 200, application/json (Hide)
POST /projects/1/notes

Payload:

1
2
3
4
{
    "name": "Single Source Note",
    "body": "Single Source Note Body"
}

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": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "Single Source Note",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Single Source Note Body",
        "body_formatted": "Single Source Note Body",
        "body_plain_text": "Single Source Note Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164188,
        "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)
POST /projects/1/notes

Payload:

1
2
3
4
{
    "name": "Source Note with Subnotes",
    "body": "Source Note with Subnotes Body"
}

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": "Source Note with Subnotes",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Source Note with Subnotes Body",
        "body_formatted": "Source Note with Subnotes Body",
        "body_plain_text": "Source Note with Subnotes Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164188,
        "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)
POST /projects/1/notes

Payload:

1
2
3
4
5
{
    "name": "Source Subnote #1",
    "body": "Source Subnote #1 Body",
    "note_id": 2
}

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
{
    "single": {
        "id": 3,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/3",
        "name": "Source 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": "Source Subnote #1 Body",
        "body_formatted": "Source Subnote #1 Body",
        "body_plain_text": "Source Subnote #1 Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164188,
        "updated_by_id": 1,
        "note_id": 2,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 1,
        "contributor_ids": [
            1
        ]
    },
    "subscribers": [
        1
    ],
    "comments": [],
    "note": {
        "id": 2,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/2",
        "name": "Source Note with Subnotes",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Source Note with Subnotes Body",
        "body_formatted": "Source Note with Subnotes Body",
        "body_plain_text": "Source Note with Subnotes Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164188,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 1,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    }
}
Response: HTTP 200, application/json (Hide)
POST /projects/1/notes

Payload:

1
2
3
4
5
{
    "name": "Source Subnote #2",
    "body": "Source Subnote #2 Body",
    "note_id": 2
}

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
{
    "single": {
        "id": 4,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/4",
        "name": "Source Subnote #2",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Source Subnote #2 Body",
        "body_formatted": "Source Subnote #2 Body",
        "body_plain_text": "Source Subnote #2 Body",
        "created_on": 1430164189,
        "created_by_id": 1,
        "updated_on": 1430164189,
        "updated_by_id": 1,
        "note_id": 2,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 2,
        "contributor_ids": [
            1
        ]
    },
    "subscribers": [
        1
    ],
    "comments": [],
    "note": {
        "id": 2,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/2",
        "name": "Source Note with Subnotes",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Source Note with Subnotes Body",
        "body_formatted": "Source Note with Subnotes Body",
        "body_plain_text": "Source Note with Subnotes Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164189,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 2,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    }
}
Response: HTTP 200, application/json (Hide)
POST /projects/1/notes

Payload:

1
2
3
4
{
    "name": "Target Note",
    "body": "Target Note Body"
}

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": 5,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/5",
        "name": "Target Note",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Target Note Body",
        "body_formatted": "Target Note Body",
        "body_plain_text": "Target Note Body",
        "created_on": 1430164189,
        "created_by_id": 1,
        "updated_on": 1430164189,
        "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": []
}

If we try to move a note to another note simply by updating its note_id value, system will ignore your request:

Response: HTTP 200, application/json (Hide)
PUT /projects/1/notes/1

Payload:

1
2
3
{
    "note_id": 5
}

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": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "Single Source Note",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Single Source Note Body",
        "body_formatted": "Single Source Note Body",
        "body_plain_text": "Single Source Note Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164189,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 0,
        "is_in_collection": false,
        "position": 2,
        "contributor_ids": [
            1
        ]
    },
    "subscribers": [
        1
    ],
    "comments": [],
    "subnotes": []
}

To move a note, you need to call /move-to-note command:

Response: HTTP 200, application/json (Hide)
PUT /projects/1/notes/1/move-to-note

Payload:

1
2
3
{
    "note_id": 5
}

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": 5,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/5",
        "name": "Target Note",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Target Note Body",
        "body_formatted": "Target Note Body",
        "body_plain_text": "Target Note Body",
        "created_on": 1430164189,
        "created_by_id": 1,
        "updated_on": 1430164189,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 1,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    },
    {
        "id": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "Single Source Note",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Single Source Note Body",
        "body_formatted": "Single Source Note Body",
        "body_plain_text": "Single Source Note Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164189,
        "updated_by_id": 1,
        "note_id": 5,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 1,
        "contributor_ids": [
            1
        ]
    }
]

As a result, you will get the full collection of the target note and all of the attached subnotes.

Note with subnotes can also be moved:

Response: HTTP 200, application/json (Hide)
PUT /projects/1/notes/2/move-to-note

Payload:

1
2
3
{
    "note_id": 5
}

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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
[
    {
        "id": 5,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/5",
        "name": "Target Note",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Target Note Body",
        "body_formatted": "Target Note Body",
        "body_plain_text": "Target Note Body",
        "created_on": 1430164189,
        "created_by_id": 1,
        "updated_on": 1430164190,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 4,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    },
    {
        "id": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "Single Source Note",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Single Source Note Body",
        "body_formatted": "Single Source Note Body",
        "body_plain_text": "Single Source Note Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164189,
        "updated_by_id": 1,
        "note_id": 5,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 1,
        "contributor_ids": [
            1
        ]
    },
    {
        "id": 2,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/2",
        "name": "Source Note with Subnotes",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Source Note with Subnotes Body",
        "body_formatted": "Source Note with Subnotes Body",
        "body_plain_text": "Source Note with Subnotes Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164190,
        "updated_by_id": 1,
        "note_id": 5,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 2,
        "contributor_ids": [
            1
        ]
    },
    {
        "id": 3,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/3",
        "name": "Source 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": "Source Subnote #1 Body",
        "body_formatted": "Source Subnote #1 Body",
        "body_plain_text": "Source Subnote #1 Body",
        "created_on": 1430164188,
        "created_by_id": 1,
        "updated_on": 1430164190,
        "updated_by_id": 1,
        "note_id": 5,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 3,
        "contributor_ids": [
            1
        ]
    },
    {
        "id": 4,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/4",
        "name": "Source Subnote #2",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Source Subnote #2 Body",
        "body_formatted": "Source Subnote #2 Body",
        "body_plain_text": "Source Subnote #2 Body",
        "created_on": 1430164189,
        "created_by_id": 1,
        "updated_on": 1430164190,
        "updated_by_id": 1,
        "note_id": 5,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 4,
        "contributor_ids": [
            1
        ]
    }
]

All notes will be added at the end of the target note's collection.