Notes

To list text notes that are in a project, call /projects/:project_id/notes:

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

Response:

1
[]

Lets create a note:

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

Payload:

1
2
3
4
{
    "name": "Document Title",
    "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>"
}

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": "Document Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_formatted": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_plain_text": "Document Body\n\n* Item one\n* Item two",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164197,
        "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": []
}

and add a subpage:

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

Payload:

1
2
3
4
5
6
{
    "name": "Subpage Title",
    "body": "Subpage body",
    "note_id": 1,
    "is_hidden_from_clients": true
}

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": "Subpage Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "Subpage body",
        "body_formatted": "Subpage body",
        "body_plain_text": "Subpage body",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164197,
        "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": "Document Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_formatted": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_plain_text": "Document Body\n\n* Item one\n* Item two",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164197,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 1,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    }
}

When we try to list project notes, we'll only get main notes, but not 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
[
    {
        "id": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "Document Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_formatted": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_plain_text": "Document Body\n\n* Item one\n* Item two",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164197,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 1,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    }
]

When we fetch the first page details, we'll see that subpage is included in the result:

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
63
64
{
    "single": {
        "id": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "Document Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_formatted": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_plain_text": "Document Body\n\n* Item one\n* Item two",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164197,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 1,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    },
    "subscribers": [
        1
    ],
    "comments": [],
    "subnotes": [
        {
            "id": 2,
            "class": "Note",
            "url_path": "\/projects\/1\/notes\/2",
            "name": "Subpage Title",
            "comments_count": 0,
            "attachments": [],
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "project_id": 1,
            "is_hidden_from_clients": true,
            "body": "Subpage body",
            "body_formatted": "Subpage body",
            "body_plain_text": "Subpage body",
            "created_on": 1430164197,
            "created_by_id": 1,
            "updated_on": 1430164197,
            "updated_by_id": 1,
            "note_id": 1,
            "is_subnote": true,
            "subnotes_count": 0,
            "is_in_collection": true,
            "position": 1,
            "contributor_ids": [
                1
            ]
        }
    ]
}

If we try to fetch subpage, we'll see that there is no subnotes property:

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
{
    "single": {
        "id": 2,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/2",
        "name": "Subpage Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "Subpage body",
        "body_formatted": "Subpage body",
        "body_plain_text": "Subpage body",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164197,
        "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": "Document Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_formatted": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_plain_text": "Document Body\n\n* Item one\n* Item two",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164197,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 1,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    }
}

This is because activeCollab supports only one level of subnotes. Notice that subpates also return note property with details of the parent note when accessed directly.

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

Payload:

1
2
3
4
{
    "name": "Updated Name",
    "is_hidden_from_clients": true
}

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
{
    "single": {
        "id": 1,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/1",
        "name": "Updated Name",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_formatted": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_plain_text": "Document Body\n\n* Item one\n* Item two",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164198,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 1,
        "is_in_collection": true,
        "position": 0,
        "contributor_ids": [
            1
        ]
    },
    "subscribers": [
        1
    ],
    "comments": [],
    "subnotes": [
        {
            "id": 2,
            "class": "Note",
            "url_path": "\/projects\/1\/notes\/2",
            "name": "Subpage Title",
            "comments_count": 0,
            "attachments": [],
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "project_id": 1,
            "is_hidden_from_clients": true,
            "body": "Subpage body",
            "body_formatted": "Subpage body",
            "body_plain_text": "Subpage body",
            "created_on": 1430164197,
            "created_by_id": 1,
            "updated_on": 1430164197,
            "updated_by_id": 1,
            "note_id": 1,
            "is_subnote": true,
            "subnotes_count": 0,
            "is_in_collection": true,
            "position": 1,
            "contributor_ids": [
                1
            ]
        }
    ]
}

Note that moving first note to trash:

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": "Updated Name",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": true,
        "trashed_on": 1430164198,
        "trashed_by_id": 1,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_formatted": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_plain_text": "Document Body\n\n* Item one\n* Item two",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164198,
        "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": "Subpage Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "Subpage body",
        "body_formatted": "Subpage body",
        "body_plain_text": "Subpage body",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164198,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 0,
        "is_in_collection": false,
        "position": 0,
        "contributor_ids": [
            1
        ]
    }
}

Will not move sunotes to trash. Instead, it will make it will make the first subnote the front page of the collection, and push itself at the end of the collection:

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
{
    "single": {
        "id": 2,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/2",
        "name": "Subpage Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "Subpage body",
        "body_formatted": "Subpage body",
        "body_plain_text": "Subpage body",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164198,
        "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/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": "Updated Name",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": true,
        "trashed_on": 1430164198,
        "trashed_by_id": 1,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_formatted": "<p>Document Body<\/p><ul><li>Item one<\/li><li>Item two<\/li><\/ul>",
        "body_plain_text": "Document Body\n\n* Item one\n* Item two",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164198,
        "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": "Subpage Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "Subpage body",
        "body_formatted": "Subpage body",
        "body_plain_text": "Subpage body",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164198,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 0,
        "is_in_collection": false,
        "position": 0,
        "contributor_ids": [
            1
        ]
    }
}

And text notes listing should be empty again:

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": 2,
        "class": "Note",
        "url_path": "\/projects\/1\/notes\/2",
        "name": "Subpage Title",
        "comments_count": 0,
        "attachments": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": true,
        "body": "Subpage body",
        "body_formatted": "Subpage body",
        "body_plain_text": "Subpage body",
        "created_on": 1430164197,
        "created_by_id": 1,
        "updated_on": 1430164198,
        "updated_by_id": 1,
        "note_id": 0,
        "is_subnote": false,
        "subnotes_count": 0,
        "is_in_collection": false,
        "position": 0,
        "contributor_ids": [
            1
        ]
    }
]