Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ harrier dev

The visual content is setup in the api-content.jinja template stype page

The content set by this template is reffered to as sections, each section is set out in api.yml
The content set by this template is referred to as sections, each section is set out in api.yml

## Deploying

Expand Down
21 changes: 14 additions & 7 deletions data/actions.json
Original file line number Diff line number Diff line change
Expand Up @@ -896,20 +896,27 @@
"help_text": "When an Administrator exports data about Reports.",
"subject_types": []
},
{
"key": "EXPORTED_USERS",
"value": "EXPORTED_USERS",
"msg": "Exported Users",
"help_text": "When an Administrator exports data about Users.",
"subject_types": []
},
{
"key": "CLIENTS_EXPORT",
"value": "CLIENTS_EXPORT",
"msg": "Exported Clients",
"help_text": "When an Administrator exports data about Clients.",
"subject_types": []
},
{
"key": "CONTRACTOR_EXPORT",
"value": "CONTRACTOR_EXPORT",
"msg": "Exported Tutors",
"help_text": "When an Administrator exports data about Tutors.",
"subject_types": []
},
{
"key": "SERVICE_RECIPIENTS_EXPORT",
"value": "SERVICE_RECIPIENTS_EXPORT",
"msg": "Exported Students",
"help_text": "When an Administrator exports data about Students.",
"subject_types": []
},
{
"key": "EDITED_SYSTEM_SETTINGS",
"value": "EDITED_SYSTEM_SETTINGS",
Expand Down
17 changes: 17 additions & 0 deletions pages/agents/agents.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,20 @@ sections:
code_type: POST
code_url: /api/agents/
response: /agents/update-an-agent.json
-
title: Add a Label to an Agent
id: label-add-to-an-agent
description: /agents/label-add-to-an-agent.md
code: /agents/label-add-to-an-agent.py
code_type: POST
code_url: /api/agents/<id>/add_label/
response: /agents/label-add-to-an-agent.json
-
title: Removing a Label from an Agent
id: label-remove-from-an-agent
description: /agents/label-remove-from-an-agent.md
code: /agents/label-remove-from-an-agent.py
code_type: POST
code_url: /api/agents/<id>/add_label/
response: /agents/label-remove-from-an-agent.json

9 changes: 8 additions & 1 deletion pages/agents/get-an-agent.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
"clients": [],
"last_updated": "2020-03-16T12:23:39.056867Z",
"calendar_colour": "Brown",
"labels": [],
"labels": [
{
"id": 2,
"name": "Very important",
"machine_name": "very-important",
"url": "https://secure.tutorcruncher.com/api/labels/2/"
}
],
"extra_attrs": []
}
41 changes: 41 additions & 0 deletions pages/agents/label-add-to-an-agent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"id": 65,
"user": {
"title": null,
"first_name": "Billy",
"last_name": "Bob2",
"email": "[email protected]",
"mobile": "07123 456 789",
"phone": "0208 123 4567",
"street": "8 Albert Road",
"state": null,
"town": "London",
"country": "United Kingdom (GB)",
"postcode": "E80 1FA",
"latitude": "51.5373258999999990",
"longitude": "-0.1496343000000000",
"date_created": "2020-02-18T16:13:04.193340Z",
"timezone": "Europe/London"
},
"commission_rate": null,
"clients": [],
"last_updated": "2020-03-16T12:23:39.056867Z",
"calendar_colour": "Brown",
"labels": [
{
"id": 2,
"name": "Very important",
"machine_name": "very-important",
"url": "https://secure.tutorcruncher.com/api/labels/2/"
}
],
"extra_attrs": [
{
"id": 1,
"value": "1993-06-23",
"type": "Date",
"machine_name": "user-dob",
"name": "Date of birth"
}
]
}
5 changes: 5 additions & 0 deletions pages/agents/label-add-to-an-agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Adding a Label to an Agent

For more information on Labels, see the [Labels](#label-object) section. Bear in mind that if the Label has been set up to email admins when added to an object, adding a Label through the API will trigger the email.

If you add a Label that has already been added to an object, the Label will not be added again and you will get a normal `200` response.
8 changes: 8 additions & 0 deletions pages/agents/label-add-to-an-agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
data = {
'label': 2,
}
r = requests.post('https://secure.tutorcruncher.com/api/agents/65/add_label/', json=data, headers=headers)
pprint.pprint(r.json())
34 changes: 34 additions & 0 deletions pages/agents/label-remove-from-an-agent.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"id": 65,
"user": {
"title": null,
"first_name": "Billy",
"last_name": "Bob2",
"email": "[email protected]",
"mobile": "07123 456 789",
"phone": "0208 123 4567",
"street": "8 Albert Road",
"state": null,
"town": "London",
"country": "United Kingdom (GB)",
"postcode": "E80 1FA",
"latitude": "51.5373258999999990",
"longitude": "-0.1496343000000000",
"date_created": "2020-02-18T16:13:04.193340Z",
"timezone": "Europe/London"
},
"commission_rate": null,
"clients": [],
"last_updated": "2020-03-16T12:23:39.056867Z",
"calendar_colour": "Brown",
"labels": [],
"extra_attrs": [
{
"id": 1,
"value": "1993-06-23",
"type": "Date",
"machine_name": "user-dob",
"name": "Date of birth"
}
]
}
5 changes: 5 additions & 0 deletions pages/agents/label-remove-from-an-agent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Removing a Label from an Agent

For more information on Labels, see the [Labels](#label-object) section.

If you remove a Label that has already been removed to an object, you will get a normal `200` response.
8 changes: 8 additions & 0 deletions pages/agents/label-remove-from-an-agent.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
data = {
'label': 2,
}
r = requests.post('https://secure.tutorcruncher.com/api/agents/65/remove_label/', json=data, headers=headers)
pprint.pprint(r.json())
16 changes: 16 additions & 0 deletions pages/clients/clients.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,19 @@ sections:
code_type: POST
code_url: /api/clients/
response: /clients/update-a-client.json
-
title: Add a Label to a Client
id: label-add-to-a-client
description: /clients/label-add-to-a-client.md
code: /clients/label-add-to-a-client.py
code_type: POST
code_url: /api/clients/<id>/add_label/
response: /clients/label-add-to-a-client.json
-
title: Removing a Label from a Client
id: label-remove-from-a-client
description: /clients/label-remove-from-a-client.md
code: /clients/label-remove-from-a-client.py
code_type: POST
code_url: /api/clients/<id>/add_label/
response: /clients/label-remove-from-a-client.json
9 changes: 8 additions & 1 deletion pages/clients/get-a-client.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,14 @@
}
],
"calendar_colour": "ForestGreen",
"labels": [],
"labels": [
{
"id": 2,
"name": "Very important",
"machine_name": "very-important",
"url": "https://secure.tutorcruncher.com/api/labels/2/"
}
],
"extra_attrs": [
{
"id": 1,
Expand Down
86 changes: 86 additions & 0 deletions pages/clients/label-add-to-a-client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"id": 3,
"user": {
"title": "Mr",
"first_name": "Jamie",
"last_name": "Hoskins",
"email": "[email protected]",
"mobile": "0207 1128 953",
"phone": null,
"street": "12 Helmet Row",
"state": null,
"town": "London",
"country": "United Kingdom (GB)",
"postcode": "EC1V 3QJ",
"latitude": "51.5249280000000027",
"longitude": "-0.0944689940000000",
"date_created": "2020-01-01T12:00:00.000000Z",
"timezone": null
},
"status": "live",
"is_taxable": true,
"received_notifications": [
"invoice_reminders",
"invoices",
"apt_reminders",
"pfi_reminders",
"credit-requests",
"low_balance_reminders",
"broadcasts"
],
"charge_via_branch": false,
"invoices_count": 4,
"payment_pending": "100.50",
"auto_charge": true,
"associated_admin": {
"id": 2,
"first_name": "Diana",
"last_name": "Lafayette",
"email": "[email protected]"
},
"associated_agent": null,
"pipeline_stage": null,
"paid_recipients": [
{
"id": 4,
"first_name": "Arthur",
"last_name": "Hoskins",
"email": "[email protected]",
"url": "https://secure.tutorcruncher.com/api/recipients/4/"
},
{
"id": 6,
"first_name": "Harry",
"last_name": "Hoskins",
"email": "[email protected]",
"url": "https://secure.tutorcruncher.com/api/recipients/6/"
},
{
"id": 5,
"first_name": "Archie",
"last_name": "Hoskins",
"email": "[email protected]",
"url": "https://secure.tutorcruncher.com/api/recipients/5/"
}
],
"calendar_colour": "ForestGreen",
"labels": [
{
"id": 2,
"name": "Very important",
"machine_name": "very-important",
"url": "https://secure.tutorcruncher.com/api/labels/2/"
}
],
"extra_attrs": [
{
"id": 1,
"value": "",
"type": "Date",
"machine_name": "client-dob",
"name": "Date of birth"
}
],
"invoice_balance": "-120.00",
"available_balance": "-220.50"
}
5 changes: 5 additions & 0 deletions pages/clients/label-add-to-a-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Adding a Label to a Client

For more information on Labels, see the [Labels](#label-object) section. Bear in mind that if the Label has been set up to email admins when added to an object, adding a Label through the API will trigger the email.

If you add a Label that has already been added to an object, the Label will not be added again and you will get a normal `200` response.
8 changes: 8 additions & 0 deletions pages/clients/label-add-to-a-client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
data = {
'label': 2,
}
r = requests.post('https://secure.tutorcruncher.com/api/clients/3/add_label/', json=data, headers=headers)
pprint.pprint(r.json())
34 changes: 34 additions & 0 deletions pages/clients/label-remove-from-a-client.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"id": 65,
"user": {
"title": null,
"first_name": "Billy",
"last_name": "Bob2",
"email": "[email protected]",
"mobile": "07123 456 789",
"phone": "0208 123 4567",
"street": "8 Albert Road",
"state": null,
"town": "London",
"country": "United Kingdom (GB)",
"postcode": "E80 1FA",
"latitude": "51.5373258999999990",
"longitude": "-0.1496343000000000",
"date_created": "2020-02-18T16:13:04.193340Z",
"timezone": "Europe/London"
},
"commission_rate": null,
"clients": [],
"last_updated": "2020-03-16T12:23:39.056867Z",
"calendar_colour": "Brown",
"labels": [],
"extra_attrs": [
{
"id": 1,
"value": "1993-06-23",
"type": "Date",
"machine_name": "user-dob",
"name": "Date of birth"
}
]
}
5 changes: 5 additions & 0 deletions pages/clients/label-remove-from-a-client.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Removing a Label from a Client

For more information on Labels, see the [Labels](#label-object) section.

If you remove a Label that has already been removed to an object, you will get a normal `200` response.
8 changes: 8 additions & 0 deletions pages/clients/label-remove-from-a-client.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
data = {
'label': 2,
}
r = requests.post('https://secure.tutorcruncher.com/api/clients/3/remove_label/', json=data, headers=headers)
pprint.pprint(r.json())
16 changes: 16 additions & 0 deletions pages/contractors/contractors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,20 @@ sections:
code_type: POST
code_url: /api/contractors/
response: /contractors/update-a-contractor.json
-
title: Add a Label to a Contractor
id: label-add-to-a-contractor
description: /contractors/label-add-to-a-contractor.md
code: /contractors/label-add-to-a-contractor.py
code_type: POST
code_url: /api/contractors/<id>/add_label/
response: /contractors/label-add-to-a-contractor.json
-
title: Removing a Label from a Contractor
id: label-remove-from-a-contractor
description: /contractors/label-remove-from-a-contractor.md
code: /contractors/label-remove-from-a-contractor.py
code_type: POST
code_url: /api/contractors/<id>/add_label/
response: /contractors/label-remove-from-a-contractor.json

Loading
Loading