Delete Note with Subnotes

For the purpose of this test, we'll create a note and two subnotes:

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

Payload:

1
2
3
4
{
    "name": "Note with Subnotes",
    "body": "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": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "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": "Note with Subnotes Body",
        "body_formatted": "Note with Subnotes Body",
        "body_plain_text": "Note with Subnotes Body",
        "created_on": 1430164170,
        "created_by_id": 1,
        "updated_on": 1430164170,
        "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": "Subnote #1",
    "body": "Subnote #1 Body",
    "note_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
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": 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": "Subnote #1 Body",
        "body_formatted": "Subnote #1 Body",
        "body_plain_text": "Subnote #1 Body",
        "created_on": 1430164170,
        "created_by_id": 1,
        "updated_on": 1430164170,
        "updated_by_id": 1,
        "note_id": 1,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 1,
        "contributor_ids": [
            1
        ]
    },
    "subscribers": [
        1
    ],
    "comments": [],
    "note": {
        "id": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "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": "Note with Subnotes Body",
        "body_formatted": "Note with Subnotes Body",
        "body_plain_text": "Note with Subnotes Body",
        "created_on": 1430164170,
        "created_by_id": 1,
        "updated_on": 1430164170,
        "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": "Subnote #2",
    "body": "Subnote #2 Body",
    "note_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
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": "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": "Subnote #2 Body",
        "body_formatted": "Subnote #2 Body",
        "body_plain_text": "Subnote #2 Body",
        "created_on": 1430164171,
        "created_by_id": 1,
        "updated_on": 1430164171,
        "updated_by_id": 1,
        "note_id": 1,
        "is_subnote": true,
        "subnotes_count": 0,
        "is_in_collection": true,
        "position": 2,
        "contributor_ids": [
            1
        ]
    },
    "subscribers": [
        1
    ],
    "comments": [],
    "note": {
        "id": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "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": "Note with Subnotes Body",
        "body_formatted": "Note with Subnotes Body",
        "body_plain_text": "Note with Subnotes Body",
        "created_on": 1430164170,
        "created_by_id": 1,
        "updated_on": 1430164171,
        "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": "Note without Subnotes",
    "body": "Note without 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": 4,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/4",
        "name": "Note without Subnotes",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "Note without Subnotes Body",
        "body_formatted": "Note without Subnotes Body",
        "body_plain_text": "Note without Subnotes Body",
        "created_on": 1430164171,
        "created_by_id": 1,
        "updated_on": 1430164171,
        "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": []
}

When we delete a note:

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

First subnote became primary note and inherited old note's position:

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

Second page remained a subpage, but it is now attached to the new main page:

Response: HTTP 200, application/json (Hide)
GET /projects/1/notes/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
{
    "single": {
        "id": 3,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/3",
        "name": "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": "Subnote #2 Body",
        "body_formatted": "Subnote #2 Body",
        "body_plain_text": "Subnote #2 Body",
        "created_on": 1430164171,
        "created_by_id": 1,
        "updated_on": 1430164171,
        "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": "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": "Subnote #1 Body",
        "body_formatted": "Subnote #1 Body",
        "body_plain_text": "Subnote #1 Body",
        "created_on": 1430164170,
        "created_by_id": 1,
        "updated_on": 1430164171,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 1,
        "is_in_collection": true,
        "position": 1,
        "contributor_ids": [
            1
        ]
    }
}