Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions pages/agents/update-an-agent.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
### Update an Agent

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

Check out [Creating/Updating Users](#creating-updating-users) for more information on linking to a specific user.
6 changes: 3 additions & 3 deletions pages/appointments/appointment-object.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,12 @@ filters:
description: Filter by the Appointment's linked Job (id).
-
name: contractor
type: string
type: integer
description: Filter by the Appointment's linked Tutor (id).
-
name: recipient
type: integer
description: Filter by the Appointment's recipient email address (id).
type: string
description: Filter by the Appointment's recipient email address.
-
name: location
type: integer
Expand Down
5 changes: 2 additions & 3 deletions pages/clients/update-a-client.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
### Update a Client

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

Check out [Creating/Updating Users](#creating-updating-users) for more information on linking to a specific user.
5 changes: 2 additions & 3 deletions pages/contractors/update-a-contractor.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
### Update a Contractor

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

Check out [Creating/Updating Users](#creating-updating-users) for more information on linking to a specific user.
5 changes: 2 additions & 3 deletions pages/recipients/update-a-recipient.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
### Update a Recipient

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

Check out [Creating/Updating Users](#creating-updating-users) for more information on linking to a specific user.
45 changes: 45 additions & 0 deletions pages/services/create-update-cj.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"allow_proposed_rates": false,
"branch": 3,
"branch_tax_setup": "Default Company Tax (20%)",
"cap": null,
"colour": "SlateGray",
"conjobs": [
{
"contractor": 43,
"contractor_permissions": "edit",
"name": "last_namé_4",
"pay_rate": "100.00"
},
],
"contractor_tax_setup": "Default Tutor Tax (no tax)",
"created": "2018-01-02T12:00:00Z",
"description": "servicé 0",
"dft_charge_type": "hourly",
"dft_charge_rate": 100.0,
"dft_contractor_permissions": "add-edit-complete",
"dft_contractor_rate": 50.0,
"dft_location": null,
"dft_max_srs": null,
"extra_attrs": [],
"extra_fee_per_apt": null,
"id": 302,
"inactivity_time": 14,
"is_bookable": false,
"is_deleted": false,
"labels": [],
"last_updated": "2025-02-26T11:58:03.204439Z",
"latest_apt_ahc": "2025-02-26T11:58:02.644095Z",
"name": "Servicé 0",
"net_gross": "gross",
"rcrs": [],
"report_required": false,
"require_con_job": true,
"require_rcr": true,
"review_units": null,
"sales_codes": null,
"desired_skills": [],
"sr_premium": null,
"status": "available",
"total_apt_units": 2.0
}
7 changes: 7 additions & 0 deletions pages/services/create-update-cj.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Add/Edit Contractor on Service

This endpoint is for existing Services. To add a new Contractor or edit an existing
Contractor's `pay_rate`, simply supply the Contractor's ID and the `pay_rate`. The `pay_rate`
is not required and if no value is passed we will use the Service's `dft_pay_rate` or keep their existing `pay_rate`.
This will not update any pay rates on existing appointments and will not be able to add contractors to existing
appointments. To add a contractor to an existing appointment, use the `Add/Edit Contractor on Appointment` endpoint.
10 changes: 10 additions & 0 deletions pages/services/create-update-cj.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
data = {
"contractor": 43,
"pay_rate": "100.00",
"contractor_permissions": "edit"
}
r = requests.post('https://secure.tutorcruncher.com/api/services/<id>/contractor/add/', json=data, headers=headers)
pprint.pprint(r.json())
49 changes: 49 additions & 0 deletions pages/services/create-update-rcr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"allow_proposed_rates": false,
"branch": 411,
"branch_tax_setup": "Default Company Tax (20%)",
"cap": null,
"colour": "Tomato",
"conjobs": [],
"contractor_tax_setup": "Default Tutor Tax (no tax)",
"created": "2018-01-02T12:00:00Z",
"description": "servicé 0",
"dft_charge_type": "hourly",
"dft_charge_rate": 100.0,
"dft_contractor_permissions": "add-edit-complete",
"dft_contractor_rate": 50.0,
"dft_location": null,
"dft_max_srs": null,
"extra_attrs": [],
"extra_fee_per_apt": null,
"id": 304,
"inactivity_time": 14,
"is_bookable": false,
"is_deleted": false,
"labels": [],
"last_updated": "2025-02-26T12:09:38.307429Z",
"latest_apt_ahc": "2025-02-26T12:09:37.736799Z",
"name": "Servicé 0",
"net_gross": "gross",
"rcrs": [
{
"recipient": 2007,
"recipient_name": "last_namé_0",
"paying_client": 2006,
"paying_client_name": "last_namé_1",
"charge_rate": "100.00",
"agent": 2012,
"agent_name": "last_namé_6",
"agent_percentage": "10.000",
}
],
"report_required": false,
"require_con_job": True,
"require_rcr": True,
"review_units": null,
"sales_codes": null,
"desired_skills": [],
"sr_premium": null,
"status": "available",
"total_apt_units": 2.0
}
7 changes: 7 additions & 0 deletions pages/services/create-update-rcr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
### Add/Edit Recipient on Service

To add a new Recipient or edit an existing Recipient's `charge_rate`, simply supply the Recipient's ID and
the `charge_rate`. The `charge_rate` is not required and if no value is passed we will use the Service's
`dft_charge_rate` or keep their existing `charge_rate`.
This will not update any charge rates on existing appointments and will not be able to add recipients to existing
appointments. To add a recipient to an existing appointment, use the `Add/Edit Recipient on Appointment` endpoint.
11 changes: 11 additions & 0 deletions pages/services/create-update-rcr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
data = {
'recipient': 2007,
'charge_rate': 100,
'agent': 2012,
'agent_percentage': 10,
}
r = requests.post('https://secure.tutorcruncher.com/api/services/<id>/recipient/add/', json=data, headers=headers)
pprint.pprint(r.json())
38 changes: 38 additions & 0 deletions pages/services/remove-cj.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"allow_proposed_rates": false,
"branch": 414,
"branch_tax_setup": "Default Company Tax (20%)",
"cap": null,
"colour": "MediumBlue",
"conjobs": [],
"contractor_tax_setup": "Default Tutor Tax (no tax)",
"created": "2018-01-02T12:00:00Z",
"description": "servicé 0",
"dft_charge_type": "hourly",
"dft_charge_rate": 100.0,
"dft_contractor_permissions": "add-edit-complete",
"dft_contractor_rate": 50.0,
"dft_location": null,
"dft_max_srs": null,
"extra_attrs": [],
"extra_fee_per_apt": null,
"id": 307,
"inactivity_time": 14,
"is_bookable": false,
"is_deleted": false,
"labels": [],
"last_updated": "2025-02-26T12:16:28.193502Z",
"latest_apt_ahc": "2025-02-26T12:16:27.644631Z",
"name": "Servicé 0",
"net_gross": "gross",
"rcrs": [],
"report_required": false,
"require_con_job": true,
"require_rcr": true,
"review_units": null,
"sales_codes": null,
"desired_skills": [],
"sr_premium": null,
"status": "available",
"total_apt_units": 2.0,
}
4 changes: 4 additions & 0 deletions pages/services/remove-cj.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Remove Contractor from Service

To remove a Contractor from a Service simply pass the Contractor's ID in the field `contractor`.
It is not possible to remove a Contractor from a Service if they are currently assigned to any Appointments.
8 changes: 8 additions & 0 deletions pages/services/remove-cj.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
data = {
"contractor": 43,
}
r = requests.post('https://secure.tutorcruncher.com/api/services/<id>/contractor/remove/', json=data, headers=headers)
pprint.pprint(r.json())
38 changes: 38 additions & 0 deletions pages/services/remove-rcr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"allow_proposed_rates": false,
"branch": 412,
"branch_tax_setup": "Default Company Tax (20%)",
"cap": null,
"colour": "PeachPuff",
"conjobs": [],
"contractor_tax_setup": "Default Tutor Tax (no tax)",
"created": "2018-01-02T12:00:00Z",
"description": "servicé 0",
"dft_charge_type": "hourly",
"dft_charge_rate": 100.0,
"dft_contractor_permissions": "add-edit-complete",
"dft_contractor_rate": 50.0,
"dft_location": null,
"dft_max_srs": null,
"extra_attrs": [],
"extra_fee_per_apt": null,
"id": 305,
"inactivity_time": 14,
"is_bookable": false,
"is_deleted": false,
"labels": [],
"last_updated": "2025-02-26T12:12:20.165851Z",
"latest_apt_ahc": "2025-02-26T12:12:19.585970Z",
"name": "Servicé 0",
"net_gross": "gross",
"rcrs": [],
"report_required": false,
"require_con_job": true,
"require_rcr": true,
"review_units": null,
"sales_codes": null,
"desired_skills": [],
"sr_premium": null,
"status": "available",
"total_apt_units": 2.0,
}
4 changes: 4 additions & 0 deletions pages/services/remove-rcr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Remove Recipient from Service

To remove a Recipient from a Service simply pass the Recipient's ID in the field `recipient`.
It is not possible to remove a Recipient from a Service if they are currently assigned to any Appointments.
8 changes: 8 additions & 0 deletions pages/services/remove-rcr.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
data = {
"recipient": 23,
}
r = requests.post('https://secure.tutorcruncher.com/api/services/<id>/recipient/remove/', json=data, headers=headers)
pprint.pprint(r.json())
44 changes: 38 additions & 6 deletions pages/services/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,42 @@ sections:
code_url: /api/services/<id>/add_label/
response: /services/label-add-to-a-service.json
-
title: Add a Label to a Recipient
id: label-add-to-a-recipient
description: /recipients/label-add-to-a-recipient.md
code: /recipients/label-add-to-a-recipient.py
title: Removing a Label from a Service
id: label-remove-from-a-service
description: /services/label-remove-from-a-service.md
code: /services/label-remove-from-a-service.py
code_type: POST
code_url: /api/recipients/<id>/add_label/
response: /recipients/label-add-to-a-recipient.json
code_url: /api/services/<id>/remove_label/
response: /services/label-remove-from-a-service.json
-
title: Add a Contractor to a Service
id: create-update-cj
description: /services/create-update-cj.md
code: /services/create-update-cj.py
code_type: POST
code_url: /api/services/<id>/add/
response: /services/create-update-cj.json
-
title: Remove a Contractor from a Service
id: remove-cj
description: /services/remove-cj.md
code: /services/remove-cj.py
code_type: POST
code_url: /api/services/<id>/remove/
response: /services/remove-cj.json
-
title: Add a Recipient to a Service
id: create-update-rcr
description: /services/create-update-rcr.md
code: /services/create-update-rcr.py
code_type: POST
code_url: /api/services/<id>/add/
response: /services/create-update-rcr.json
-
title: Remove a Recipient from a Service
id: remove-rcr
description: /services/remove-rcr.md
code: /services/remove-rcr.py
code_type: POST
code_url: /api/services/<id>/remove/
response: /services/remove-rcr.json
26 changes: 26 additions & 0 deletions pages/tenders/accept-a-tender.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"id": 73,
"description": "I love science",
"contractor": {
"id": 1985,
"first_name": null,
"last_name": "Teacherson",
"email": "[email protected]",
"url": "https://secure.tutorcruncher.com/api/contractors/1985/"
},
"created": "2019-01-01T00:00:00Z",
"proposed_rate": null,
"service": {
"id": 300,
"name": "Jobalot",
"dft_charge_type": "hourly",
"created": "2019-01-01T00:00:00Z",
"dft_charge_rate": "100.00",
"dft_contractor_rate": "50.00",
"last_updated": "2025-02-25T17:30:52.234437Z",
"status": "available",
"url": "https://secure.tutorcruncher.com/api/services/300/"
},
"status": "accepted"
}

4 changes: 4 additions & 0 deletions pages/tenders/accept-a-tender.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Accept a tender

Accepts an existing tender, adding the related contractor to the Service. Functions the same as if a job application
was approved through the UI.
5 changes: 5 additions & 0 deletions pages/tenders/accept-a-tender.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
r = requests.post('https://secure.tutorcruncher.com/api/tenders/<id>/accept/', headers=headers)
pprint.pprint(r.json())
Loading