Visibility

Personas in this Story: Default, ProjectLeader, Member, Subcontractor, Client.

This article covers visibility of expense. In broad strokes:

  1. Only owners and project leader always see all expenses in a project,
  2. Members and sucontractors see only their records,
  3. Client see expeses only if they were given permission to access tracked expenses and budget information.

Lets start by inviting people. We need two employees, where first will lead projects and second will be a regular team member. We also need a client and a subcontractor, to check how their permissions work:

Response: HTTP 200, application/json (Hide)
POST /users

Payload:

1
2
3
4
5
6
7
8
{
    "type": "Member",
    "email": "project-leader@activecollab.com",
    "password": "123",
    "custom_permissions": [
        "can_manage_projects"
    ]
}

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
{
    "single": {
        "id": 2,
        "class": "Member",
        "url_path": "\/users\/2",
        "is_archived": false,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164113,
        "created_by_id": 1,
        "updated_on": 1430164113,
        "updated_by_id": 1,
        "language_id": 0,
        "first_name": "Project-leader",
        "last_name": null,
        "display_name": "project-leader",
        "short_display_name": "project-leader",
        "email": "project-leader@activecollab.com",
        "additional_email_addresses": [],
        "is_pending_activation": false,
        "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=2&size=--SIZE--&timestamp=1430164113",
        "custom_permissions": [
            "can_manage_projects"
        ],
        "company_id": 0,
        "title": null,
        "phone": null,
        "im_type": null,
        "im_handle": null,
        "note": null
    }
}
Response: HTTP 200, application/json (Hide)
POST /users

Payload:

1
2
3
4
5
{
    "type": "Member",
    "email": "member@activecollab.com",
    "password": "123"
}

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
{
    "single": {
        "id": 3,
        "class": "Member",
        "url_path": "\/users\/3",
        "is_archived": false,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164113,
        "created_by_id": 1,
        "updated_on": 1430164113,
        "updated_by_id": 1,
        "language_id": 0,
        "first_name": "Member",
        "last_name": null,
        "display_name": "member",
        "short_display_name": "member",
        "email": "member@activecollab.com",
        "additional_email_addresses": [],
        "is_pending_activation": false,
        "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=3&size=--SIZE--&timestamp=1430164113",
        "custom_permissions": [],
        "company_id": 0,
        "title": null,
        "phone": null,
        "im_type": null,
        "im_handle": null,
        "note": null
    }
}
Response: HTTP 200, application/json (Hide)
POST /users

Payload:

1
2
3
4
5
{
    "type": "Subcontractor",
    "email": "subcontractor@activecollab.com",
    "password": "123"
}

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
{
    "single": {
        "id": 4,
        "class": "Subcontractor",
        "url_path": "\/users\/4",
        "is_archived": false,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164113,
        "created_by_id": 1,
        "updated_on": 1430164113,
        "updated_by_id": 1,
        "language_id": 0,
        "first_name": "Subcontractor",
        "last_name": null,
        "display_name": "subcontractor",
        "short_display_name": "subcontractor",
        "email": "subcontractor@activecollab.com",
        "additional_email_addresses": [],
        "is_pending_activation": false,
        "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=4&size=--SIZE--&timestamp=1430164113",
        "custom_permissions": [],
        "company_id": 0,
        "title": null,
        "phone": null,
        "im_type": null,
        "im_handle": null,
        "note": null
    }
}
Response: HTTP 200, application/json (Hide)
POST /users

Payload:

1
2
3
4
5
{
    "type": "Client",
    "email": "client@activecollab.com",
    "password": "123"
}

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
{
    "single": {
        "id": 5,
        "class": "Client",
        "url_path": "\/users\/5",
        "is_archived": false,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164114,
        "created_by_id": 1,
        "updated_on": 1430164114,
        "updated_by_id": 1,
        "language_id": 0,
        "first_name": "Client",
        "last_name": null,
        "display_name": "client",
        "short_display_name": "client",
        "email": "client@activecollab.com",
        "additional_email_addresses": [],
        "is_pending_activation": false,
        "avatar_url": "http:\/\/feather.dev\/proxy.php?proxy=avatar&module=system&v=current&b=DEV&user_id=5&size=--SIZE--&timestamp=1430164114",
        "custom_permissions": [],
        "company_id": 0,
        "title": null,
        "phone": null,
        "im_type": null,
        "im_handle": null,
        "note": null
    }
}

Now, project leader will create a new project and invite people to join:

Response: HTTP 200, application/json (Hide)
POST /projects (as ProjectLeader)

Payload:

1
2
3
4
5
6
7
8
9
10
11
{
    "name": "Test Project",
    "company_id": 2,
    "leader_id": 2,
    "members": [
        3,
        4,
        5
    ],
    "is_tracking_enabled": 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
{
    "single": {
        "id": 1,
        "class": "Project",
        "url_path": "\/projects\/1",
        "name": "Test Project",
        "completed_on": null,
        "completed_by_id": null,
        "is_completed": false,
        "members": [
            2,
            3,
            4,
            5
        ],
        "category_id": 0,
        "label_id": 0,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164114,
        "created_by_id": 2,
        "updated_on": 1430164114,
        "updated_by_id": 2,
        "body": null,
        "body_formatted": "",
        "company_id": 2,
        "leader_id": 2,
        "currency_id": 2,
        "template_id": 0,
        "based_on_type": null,
        "based_on_id": null,
        "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
        "is_tracking_enabled": true,
        "is_client_reporting_enabled": false,
        "budget": null,
        "count_tasks": 0,
        "count_discussions": 0,
        "count_files": 0,
        "count_notes": 0
    },
    "category": null,
    "hourly_rates": {
        "1": 100
    },
    "label_ids": [],
    "task_lists": null
}
Response: HTTP 200, application/json (Hide)
POST /projects/1/tasks (as ProjectLeader)

Payload:

1
2
3
{
    "name": "Task #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
{
    "single": {
        "id": 1,
        "class": "Task",
        "url_path": "\/projects\/1\/tasks\/1",
        "name": "Task #1",
        "assignee_id": 0,
        "delegated_by_id": 0,
        "completed_on": null,
        "completed_by_id": null,
        "is_completed": false,
        "comments_count": 0,
        "attachments": [],
        "labels": [],
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "project_id": 1,
        "is_hidden_from_clients": false,
        "body": "",
        "body_formatted": "",
        "created_on": 1430164114,
        "created_by_id": 2,
        "updated_on": 1430164114,
        "updated_by_id": 2,
        "task_number": 1,
        "task_list_id": 0,
        "position": 1,
        "is_important": false,
        "due_on": null,
        "estimate": 0,
        "job_type_id": 0,
        "total_subtasks": 0,
        "completed_subtasks": 0,
        "open_subtasks": 0
    },
    "subscribers": [
        2
    ],
    "comments": [],
    "reminders": [],
    "subtasks": [],
    "task_list": null,
    "tracked_time": 0,
    "tracked_expenses": 0
}

Now member and subcontractor will track some expenses:

Response: HTTP 200, application/json (Hide)
POST /projects/1/expenses (as Member)

Payload:

1
2
3
4
5
6
{
    "value": 330,
    "user_id": 3,
    "category_id": 1,
    "record_date": "2014-05-14"
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
    "single": {
        "id": 1,
        "class": "Expense",
        "url_path": "\/projects\/1\/expenses\/1",
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "billable_status": 1,
        "value": 330,
        "record_date": 1400025600,
        "summary": null,
        "user_id": 3,
        "parent_type": "Project",
        "parent_id": 1,
        "created_on": 1430164115,
        "created_by_id": 3,
        "updated_on": 1430164115,
        "updated_by_id": 3,
        "category_id": 1,
        "currency_id": 2
    }
}
Response: HTTP 200, application/json (Hide)
POST /projects/1/expenses (as Subcontractor)

Payload:

1
2
3
4
5
6
{
    "value": 230,
    "user_id": 4,
    "category_id": 1,
    "record_date": "2014-05-14"
}

Response:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
{
    "single": {
        "id": 2,
        "class": "Expense",
        "url_path": "\/projects\/1\/expenses\/2",
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "billable_status": 1,
        "value": 230,
        "record_date": 1400025600,
        "summary": null,
        "user_id": 4,
        "parent_type": "Project",
        "parent_id": 1,
        "created_on": 1430164115,
        "created_by_id": 4,
        "updated_on": 1430164115,
        "updated_by_id": 4,
        "category_id": 1,
        "currency_id": 2
    }
}

One important thing to notice is that only owner and project leader can track expenses for other people:

Response: HTTP 200, application/json (Hide)
POST /projects/1/expenses (as ProjectLeader)

Payload:

1
2
3
4
5
6
7
{
    "value": 530,
    "user_id": 3,
    "category_id": 1,
    "record_date": "2014-05-14",
    "task_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
{
    "single": {
        "id": 3,
        "class": "Expense",
        "url_path": "\/projects\/1\/expenses\/3",
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "billable_status": 1,
        "value": 530,
        "record_date": 1400025600,
        "summary": null,
        "user_id": 3,
        "parent_type": "Task",
        "parent_id": 1,
        "created_on": 1430164116,
        "created_by_id": 2,
        "updated_on": 1430164116,
        "updated_by_id": 2,
        "category_id": 1,
        "currency_id": 2
    }
}
Response: HTTP 200, application/json (Hide)
POST /projects/1/expenses

Payload:

1
2
3
4
5
6
7
{
    "value": 130,
    "user_id": 4,
    "category_id": 1,
    "record_date": "2014-05-14",
    "task_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
{
    "single": {
        "id": 4,
        "class": "Expense",
        "url_path": "\/projects\/1\/expenses\/4",
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "billable_status": 1,
        "value": 130,
        "record_date": 1400025600,
        "summary": null,
        "user_id": 4,
        "parent_type": "Task",
        "parent_id": 1,
        "created_on": 1430164117,
        "created_by_id": 1,
        "updated_on": 1430164117,
        "updated_by_id": 1,
        "category_id": 1,
        "currency_id": 2
    }
}

If member or subcontractor try to do that, value of user_id will be ignored and record will be tracked for their accounts instead:

Response: HTTP 200, application/json (Hide)
POST /projects/1/expenses (as Member)

Payload:

1
2
3
4
5
6
7
{
    "value": 30,
    "user_id": "$subcontractor",
    "category_id": 1,
    "record_date": "2014-05-14",
    "task_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
{
    "single": {
        "id": 5,
        "class": "Expense",
        "url_path": "\/projects\/1\/expenses\/5",
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "billable_status": 1,
        "value": 30,
        "record_date": 1400025600,
        "summary": null,
        "user_id": 3,
        "parent_type": "Task",
        "parent_id": 1,
        "created_on": 1430164117,
        "created_by_id": 3,
        "updated_on": 1430164117,
        "updated_by_id": 3,
        "category_id": 1,
        "currency_id": 2
    }
}
Response: HTTP 200, application/json (Hide)
POST /projects/1/expenses (as Subcontractor)

Payload:

1
2
3
4
5
6
7
{
    "value": 2,
    "user_id": 3,
    "category_id": 1,
    "record_date": "2014-05-14",
    "task_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
{
    "single": {
        "id": 6,
        "class": "Expense",
        "url_path": "\/projects\/1\/expenses\/6",
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "billable_status": 1,
        "value": 2,
        "record_date": 1400025600,
        "summary": null,
        "user_id": 4,
        "parent_type": "Task",
        "parent_id": 1,
        "created_on": 1430164117,
        "created_by_id": 4,
        "updated_on": 1430164117,
        "updated_by_id": 4,
        "category_id": 1,
        "currency_id": 2
    }
}

Clients can't track expenses:

Response: HTTP 404, text/html
POST /projects/1/expenses (as Client)

Payload:

1
2
3
4
5
6
{
    "value": 2,
    "user_id": 5,
    "category_id": 1,
    "record_date": "2014-05-14"
}

Lets see who can see what. First, owner and project leader can see all records:

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

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
{
    "expenses": [
        {
            "id": 6,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/6",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 2,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 4,
            "updated_on": 1430164117,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 5,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/5",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 30,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 3,
            "updated_on": 1430164117,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 4,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/4",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 130,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 1,
            "updated_on": 1430164117,
            "updated_by_id": 1,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 3,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/3",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 530,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164116,
            "created_by_id": 2,
            "updated_on": 1430164116,
            "updated_by_id": 2,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 2,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/2",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 230,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Project",
            "parent_id": 1,
            "created_on": 1430164115,
            "created_by_id": 4,
            "updated_on": 1430164115,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 1,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/1",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 330,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Project",
            "parent_id": 1,
            "created_on": 1430164115,
            "created_by_id": 3,
            "updated_on": 1430164115,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": false,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/tasks/1/expenses

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
    "expenses": [
        {
            "id": 6,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/6",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 2,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 4,
            "updated_on": 1430164117,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 5,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/5",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 30,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 3,
            "updated_on": 1430164117,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 4,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/4",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 130,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 1,
            "updated_on": 1430164117,
            "updated_by_id": 1,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 3,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/3",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 530,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164116,
            "created_by_id": 2,
            "updated_on": 1430164116,
            "updated_by_id": 2,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": false,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/expenses (as ProjectLeader)

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
{
    "expenses": [
        {
            "id": 6,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/6",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 2,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 4,
            "updated_on": 1430164117,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 5,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/5",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 30,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 3,
            "updated_on": 1430164117,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 4,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/4",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 130,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 1,
            "updated_on": 1430164117,
            "updated_by_id": 1,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 3,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/3",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 530,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164116,
            "created_by_id": 2,
            "updated_on": 1430164116,
            "updated_by_id": 2,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 2,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/2",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 230,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Project",
            "parent_id": 1,
            "created_on": 1430164115,
            "created_by_id": 4,
            "updated_on": 1430164115,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 1,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/1",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 330,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Project",
            "parent_id": 1,
            "created_on": 1430164115,
            "created_by_id": 3,
            "updated_on": 1430164115,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": false,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/tasks/1/expenses (as ProjectLeader)

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
    "expenses": [
        {
            "id": 6,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/6",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 2,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 4,
            "updated_on": 1430164117,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 5,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/5",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 30,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 3,
            "updated_on": 1430164117,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 4,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/4",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 130,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 1,
            "updated_on": 1430164117,
            "updated_by_id": 1,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 3,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/3",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 530,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164116,
            "created_by_id": 2,
            "updated_on": 1430164116,
            "updated_by_id": 2,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": false,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}

Members and subcontractors only see their own records:

Response: HTTP 200, application/json (Hide)
GET /projects/1/expenses (as Member)

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
143
144
145
146
147
148
{
    "expenses": [
        {
            "id": 5,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/5",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 30,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 3,
            "updated_on": 1430164117,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 3,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/3",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 530,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164116,
            "created_by_id": 2,
            "updated_on": 1430164116,
            "updated_by_id": 2,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 1,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/1",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 330,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Project",
            "parent_id": 1,
            "created_on": 1430164115,
            "created_by_id": 3,
            "updated_on": 1430164115,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": false,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/tasks/1/expenses (as Member)

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
{
    "expenses": [
        {
            "id": 5,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/5",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 30,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 3,
            "updated_on": 1430164117,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 3,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/3",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 530,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164116,
            "created_by_id": 2,
            "updated_on": 1430164116,
            "updated_by_id": 2,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": false,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/expenses (as Subcontractor)

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
143
144
145
146
147
148
{
    "expenses": [
        {
            "id": 6,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/6",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 2,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 4,
            "updated_on": 1430164117,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 4,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/4",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 130,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 1,
            "updated_on": 1430164117,
            "updated_by_id": 1,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 2,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/2",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 230,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Project",
            "parent_id": 1,
            "created_on": 1430164115,
            "created_by_id": 4,
            "updated_on": 1430164115,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": false,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/tasks/1/expenses (as Subcontractor)

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
{
    "expenses": [
        {
            "id": 6,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/6",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 2,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 4,
            "updated_on": 1430164117,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 4,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/4",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 130,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 1,
            "updated_on": 1430164117,
            "updated_by_id": 1,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": false,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}

Our project is configured so clients don't have access to tracking reports. When project is configured like that, these pages will be restirected for clients:

Response: HTTP 404, text/html
GET /projects/1/expenses (as Client)
Response: HTTP 404, text/html
GET /projects/1/tasks/1/expenses (as Client)

When we turn on client reporting, client will be able to see all records:

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

Payload:

1
2
3
{
    "is_client_reporting_enabled": 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
{
    "single": {
        "id": 1,
        "class": "Project",
        "url_path": "\/projects\/1",
        "name": "Test Project",
        "completed_on": null,
        "completed_by_id": null,
        "is_completed": false,
        "members": [
            2,
            3,
            4,
            5
        ],
        "category_id": 0,
        "label_id": 0,
        "is_trashed": false,
        "trashed_on": null,
        "trashed_by_id": 0,
        "created_on": 1430164114,
        "created_by_id": 2,
        "updated_on": 1430164119,
        "updated_by_id": 2,
        "body": null,
        "body_formatted": "",
        "company_id": 2,
        "leader_id": 2,
        "currency_id": 2,
        "template_id": 0,
        "based_on_type": null,
        "based_on_id": null,
        "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
        "is_tracking_enabled": true,
        "is_client_reporting_enabled": true,
        "budget": null,
        "count_tasks": 1,
        "count_discussions": 0,
        "count_files": 0,
        "count_notes": 0
    },
    "category": null,
    "hourly_rates": {
        "1": 100
    },
    "label_ids": [],
    "task_lists": null
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/expenses (as Client)

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
{
    "expenses": [
        {
            "id": 6,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/6",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 2,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 4,
            "updated_on": 1430164117,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 5,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/5",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 30,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 3,
            "updated_on": 1430164117,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 4,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/4",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 130,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 1,
            "updated_on": 1430164117,
            "updated_by_id": 1,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 3,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/3",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 530,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164116,
            "created_by_id": 2,
            "updated_on": 1430164116,
            "updated_by_id": 2,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 2,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/2",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 230,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Project",
            "parent_id": 1,
            "created_on": 1430164115,
            "created_by_id": 4,
            "updated_on": 1430164115,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 1,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/1",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 330,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Project",
            "parent_id": 1,
            "created_on": 1430164115,
            "created_by_id": 3,
            "updated_on": 1430164115,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164119,
                "updated_by_id": 2,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": true,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}
Response: HTTP 200, application/json (Hide)
GET /projects/1/tasks/1/expenses (as Client)

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
{
    "expenses": [
        {
            "id": 6,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/6",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 2,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 4,
            "updated_on": 1430164117,
            "updated_by_id": 4,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 5,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/5",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 30,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 3,
            "updated_on": 1430164117,
            "updated_by_id": 3,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 4,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/4",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 130,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 4,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164117,
            "created_by_id": 1,
            "updated_on": 1430164117,
            "updated_by_id": 1,
            "category_id": 1,
            "currency_id": 2
        },
        {
            "id": 3,
            "class": "Expense",
            "url_path": "\/projects\/1\/expenses\/3",
            "is_trashed": false,
            "trashed_on": null,
            "trashed_by_id": 0,
            "billable_status": 1,
            "value": 530,
            "record_date": 1400025600,
            "summary": null,
            "user_id": 3,
            "parent_type": "Task",
            "parent_id": 1,
            "created_on": 1430164116,
            "created_by_id": 2,
            "updated_on": 1430164116,
            "updated_by_id": 2,
            "category_id": 1,
            "currency_id": 2
        }
    ],
    "related": {
        "Project": {
            "1": {
                "id": 1,
                "class": "Project",
                "url_path": "\/projects\/1",
                "name": "Test Project",
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "members": [
                    2,
                    3,
                    4,
                    5
                ],
                "category_id": 0,
                "label_id": 0,
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164119,
                "updated_by_id": 2,
                "body": null,
                "body_formatted": "",
                "company_id": 2,
                "leader_id": 2,
                "currency_id": 2,
                "template_id": 0,
                "based_on_type": null,
                "based_on_id": null,
                "email": "notifications+m2p-CEjj06z@mail.manageprojects.com",
                "is_tracking_enabled": true,
                "is_client_reporting_enabled": true,
                "budget": null,
                "count_tasks": 1,
                "count_discussions": 0,
                "count_files": 0,
                "count_notes": 0
            }
        },
        "Task": {
            "1": {
                "id": 1,
                "class": "Task",
                "url_path": "\/projects\/1\/tasks\/1",
                "name": "Task #1",
                "assignee_id": 0,
                "delegated_by_id": 0,
                "completed_on": null,
                "completed_by_id": null,
                "is_completed": false,
                "comments_count": 0,
                "attachments": [],
                "labels": [],
                "is_trashed": false,
                "trashed_on": null,
                "trashed_by_id": 0,
                "project_id": 1,
                "is_hidden_from_clients": false,
                "body": "",
                "body_formatted": "",
                "created_on": 1430164114,
                "created_by_id": 2,
                "updated_on": 1430164117,
                "updated_by_id": 4,
                "task_number": 1,
                "task_list_id": 0,
                "position": 1,
                "is_important": false,
                "due_on": null,
                "estimate": 0,
                "job_type_id": 0,
                "total_subtasks": 0,
                "completed_subtasks": 0,
                "open_subtasks": 0
            }
        }
    }
}