Skip to content

Commit 700c67f

Browse files
authored
Merge pull request #190 from tutorcruncher/jobs-api-changes
Job change docs
2 parents 13123cc + 31f3f07 commit 700c67f

27 files changed

+365
-20
lines changed

pages/agents/update-an-agent.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
### Update an Agent
22

3-
Update an Agent object by supplying the ID as the unique identifier in the url. You must also supply required fields
4-
like `last_name` even if they are not being updated. You only need to post information that you want to change and
5-
not the whole Agent object.
3+
Update an Agent object by supplying the ID as the unique identifier in the url. You only need to post
4+
information that you want to change and not the whole Agent object.
65

76
Check out [Creating/Updating Users](#creating-updating-users) for more information on linking to a specific user.

pages/appointments/appointment-object.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ filters:
167167
description: Filter by the Appointment's linked Job (id).
168168
-
169169
name: contractor
170-
type: string
170+
type: integer
171171
description: Filter by the Appointment's linked Tutor (id).
172172
-
173173
name: recipient
174174
type: integer
175-
description: Filter by the Appointment's recipient email address (id).
175+
description: Filter by the Appointment's linked Student (id).
176176
-
177177
name: location
178178
type: integer

pages/clients/update-a-client.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
### Update a Client
22

3-
Update an Client object by supplying the ID as the unique identifier in the url. You must also supply required fields
4-
like `last_name` even if they are not being updated. You only need to post information that you want to change and
5-
not the whole Client object.
3+
Update an Client object by supplying the ID as the unique identifier in the url. You only need to post information
4+
that you want to change and not the whole Client object.
65

76
Check out [Creating/Updating Users](#creating-updating-users) for more information on linking to a specific user.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
### Update a Contractor
22

3-
Update an Contractor object by supplying the ID as the unique identifier in the url. You must also supply required fields
4-
like `last_name` even if they are not being updated. You only need to post information that you want to change and
5-
not the whole Contractor object.
3+
Update an Contractor object by supplying the ID as the unique identifier in the url.
4+
You only need to post information that you want to change and not the whole Contractor object.
65

76
Check out [Creating/Updating Users](#creating-updating-users) for more information on linking to a specific user.
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
### Update a Recipient
22

3-
Update an Recipient object by supplying the ID as the unique identifier in the url. You must also supply required fields
4-
like `last_name` even if they are not being updated. You only need to post information that you want to change and
5-
not the whole Recipient object.
3+
Update an Recipient object by supplying the ID as the unique identifier in the url.
4+
You only need to post information that you want to change and not the whole Recipient object.
65

76
Check out [Creating/Updating Users](#creating-updating-users) for more information on linking to a specific user.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"allow_proposed_rates": false,
3+
"branch": 3,
4+
"branch_tax_setup": "Default Company Tax (20%)",
5+
"cap": null,
6+
"colour": "SlateGray",
7+
"conjobs": [
8+
{
9+
"contractor": 43,
10+
"contractor_permissions": "edit",
11+
"name": "last_namé_4",
12+
"pay_rate": "100.00"
13+
},
14+
],
15+
"contractor_tax_setup": "Default Tutor Tax (no tax)",
16+
"created": "2018-01-02T12:00:00Z",
17+
"description": "servicé 0",
18+
"dft_charge_type": "hourly",
19+
"dft_charge_rate": 100.0,
20+
"dft_contractor_permissions": "add-edit-complete",
21+
"dft_contractor_rate": 50.0,
22+
"dft_location": null,
23+
"dft_max_srs": null,
24+
"extra_attrs": [],
25+
"extra_fee_per_apt": null,
26+
"id": 302,
27+
"inactivity_time": 14,
28+
"is_bookable": false,
29+
"is_deleted": false,
30+
"labels": [],
31+
"last_updated": "2025-02-26T11:58:03.204439Z",
32+
"latest_apt_ahc": "2025-02-26T11:58:02.644095Z",
33+
"name": "Servicé 0",
34+
"net_gross": "gross",
35+
"rcrs": [],
36+
"report_required": false,
37+
"require_con_job": true,
38+
"require_rcr": true,
39+
"review_units": null,
40+
"sales_codes": null,
41+
"desired_skills": [],
42+
"sr_premium": null,
43+
"status": "available",
44+
"total_apt_units": 2.0
45+
}

pages/services/create-update-cj.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Add/Edit Contractor on Service
2+
3+
This endpoint is for existing Services. To add a new Contractor or edit an existing
4+
Contractor's `pay_rate`, simply supply the Contractor's ID and the `pay_rate`. The `pay_rate`
5+
is not required and if no value is passed we will use the Service's `dft_pay_rate` or keep their existing `pay_rate`.
6+
This will not update any pay rates on existing appointments and will not be able to add contractors to existing
7+
appointments. To add a contractor to an existing appointment, use the `Add/Edit Contractor on Appointment` endpoint.

pages/services/create-update-cj.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import pprint, requests
2+
3+
headers = {'Authorization': 'token <API KEY>'}
4+
data = {
5+
"contractor": 43,
6+
"pay_rate": "100.00",
7+
"contractor_permissions": "edit"
8+
}
9+
r = requests.post('https://secure.tutorcruncher.com/api/services/<id>/contractor/add/', json=data, headers=headers)
10+
pprint.pprint(r.json())
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"allow_proposed_rates": false,
3+
"branch": 411,
4+
"branch_tax_setup": "Default Company Tax (20%)",
5+
"cap": null,
6+
"colour": "Tomato",
7+
"conjobs": [],
8+
"contractor_tax_setup": "Default Tutor Tax (no tax)",
9+
"created": "2018-01-02T12:00:00Z",
10+
"description": "servicé 0",
11+
"dft_charge_type": "hourly",
12+
"dft_charge_rate": 100.0,
13+
"dft_contractor_permissions": "add-edit-complete",
14+
"dft_contractor_rate": 50.0,
15+
"dft_location": null,
16+
"dft_max_srs": null,
17+
"extra_attrs": [],
18+
"extra_fee_per_apt": null,
19+
"id": 304,
20+
"inactivity_time": 14,
21+
"is_bookable": false,
22+
"is_deleted": false,
23+
"labels": [],
24+
"last_updated": "2025-02-26T12:09:38.307429Z",
25+
"latest_apt_ahc": "2025-02-26T12:09:37.736799Z",
26+
"name": "Servicé 0",
27+
"net_gross": "gross",
28+
"rcrs": [
29+
{
30+
"recipient": 2007,
31+
"recipient_name": "last_namé_0",
32+
"paying_client": 2006,
33+
"paying_client_name": "last_namé_1",
34+
"charge_rate": "100.00",
35+
"agent": 2012,
36+
"agent_name": "last_namé_6",
37+
"agent_percentage": "10.000",
38+
}
39+
],
40+
"report_required": false,
41+
"require_con_job": True,
42+
"require_rcr": True,
43+
"review_units": null,
44+
"sales_codes": null,
45+
"desired_skills": [],
46+
"sr_premium": null,
47+
"status": "available",
48+
"total_apt_units": 2.0
49+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Add/Edit Recipient on Service
2+
3+
To add a new Recipient or edit an existing Recipient's `charge_rate`, simply supply the Recipient's ID and
4+
the `charge_rate`. The `charge_rate` is not required and if no value is passed we will use the Service's
5+
`dft_charge_rate` or keep their existing `charge_rate`.
6+
This will not update any charge rates on existing appointments and will not be able to add recipients to existing
7+
appointments. To add a recipient to an existing appointment, use the `Add/Edit Recipient on Appointment` endpoint.

0 commit comments

Comments
 (0)