Skip to content

Commit cdea0f0

Browse files
committed
Update all docs to match v2 & add versioning
1 parent 04f1b6b commit cdea0f0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1749
-646
lines changed
File renamed without changes.

pages/agents/agent-object-v1.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Agent Object (Version 1 - Will be deprecated 3rd July 2025)
2+
3+
Agent objects, Affiliates in TutorCruncher, includes basic user information including fields that are only linked to the Agent Role.
4+
It includes details about affiliated Clients, `clients`, and their `commission_rate`.
File renamed without changes.

pages/agents/agent-object-v2.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"id": 65,
3+
"title": null,
4+
"first_name": "Billy",
5+
"last_name": "Holiday",
6+
"email": "[email protected]",
7+
"mobile": "07123 456 789",
8+
"phone": "0208 123 4567",
9+
"street": "8 Albert Road",
10+
"state": null,
11+
"town": "London",
12+
"country": "United Kingdom (GB)",
13+
"postcode": "E80 1FA",
14+
"latitude": "51.5373258999999990",
15+
"longitude": "-0.1496343000000000",
16+
"date_created": "2020-02-18T16:13:04.193340Z",
17+
"timezone": "Europe/London"
18+
"commission_rate": null,
19+
"clients": [],
20+
"last_updated": "2020-03-16T12:23:39.056867Z",
21+
"calendar_colour": "Brown",
22+
"labels": [],
23+
"extra_attrs": []
24+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
### Agent Object
1+
### Agent Object (Version 2)
22

33
Agent objects, Affiliates in TutorCruncher, includes basic user information including fields that are only linked to the Agent Role.
44
It includes details about affiliated Clients, `clients`, and their `commission_rate`.

pages/agents/agent-object-v2.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
attributes:
2+
-
3+
name: id
4+
type: integer
5+
description: Unique identifier for the object.
6+
-
7+
name: first_name
8+
type: string
9+
description: The user's first name.
10+
-
11+
name: last_name
12+
type: string
13+
description: The user's last name.
14+
-
15+
name: email
16+
type: string
17+
description: The user's email address.
18+
-
19+
name: mobile
20+
type: string
21+
description: The user's mobile number.
22+
-
23+
name: phone
24+
type: string
25+
description: The user's phone number.
26+
-
27+
name: street
28+
type: string
29+
description: The user's street address.
30+
-
31+
name: state
32+
type: string
33+
description: This field is only needed for US users. This value will use the state's 2-letter code.
34+
-
35+
name: town
36+
type: string
37+
description: The user's town on address.
38+
-
39+
name: country
40+
type: integer
41+
description: |
42+
User's country, value is an `id` of the country stored in TutorCruncher. These country ids can be found
43+
by doing an options request at this endpoints base URL.
44+
-
45+
name: postcode
46+
type: string
47+
description: The user's postcode on address.
48+
-
49+
name: latitude
50+
type: decimal
51+
description: The user's addresses latitude.
52+
-
53+
name: longitude
54+
type: decimal
55+
description: The user's addresses longitude.
56+
-
57+
name: date_created
58+
type: string
59+
description: The date and time the user was created.
60+
-
61+
name: timezone
62+
type: string
63+
description: The user's timezone, accepted values are timezone database values.
64+
-
65+
name: commission_rate
66+
type: string
67+
description: Percentage of the Agent's commission rate.
68+
-
69+
name: clients
70+
type: array
71+
description: An array of Clients which the Agent is related to.
72+
children:
73+
-
74+
name: id
75+
type: integer
76+
description: Unique identifier for the object.
77+
-
78+
name: first_name
79+
type: string
80+
description: User's first name.
81+
-
82+
name: last_name
83+
type: string
84+
description: User's last name.
85+
-
86+
name: email
87+
type: string
88+
description: User's email address.
89+
-
90+
name: url
91+
type: string
92+
description: URL to the Agent's object.
93+
-
94+
name: last_updated
95+
type: string
96+
description: The date and time the Agent was last updated.
97+
-
98+
name: calendar_colour
99+
type: string
100+
description: Use hex values, like `#fff000`, or use CSS Named colours.
101+
-
102+
name: labels
103+
type: array
104+
description: An array of the Agent's labels.
105+
children:
106+
-
107+
name: id
108+
type: integer
109+
description: Unique identifier for the object.
110+
-
111+
name: name
112+
type: string
113+
description: Name of the label.
114+
-
115+
name: machine_name
116+
type: string
117+
description: Unique slugified name of the label.
118+
-
119+
name: extra_attrs
120+
type: array
121+
description: |
122+
Custom fields for this object.
123+
124+
Updated with payload shape: `'extra_attrs': {'custom_field_machine_name_1': 'value_1', 'custom_field_machine_name_2': 'value_2'}`
125+
126+
filters:
127+
-
128+
name: created__gte
129+
type: string
130+
description: Filter by the date and time the Agent was created.
131+
-
132+
name: created__lte
133+
type: string
134+
description: Filter by the date and time the Agent was created.
135+
-
136+
name: first_name
137+
type: string
138+
description: Filter by the Agent's first name.
139+
-
140+
name: last_name
141+
type: string
142+
description: Filter by the Agent's last name.
143+
-
144+
name: email
145+
type: string
146+
description: Filter by the Agent's email address.
147+
-
148+
name: status
149+
type: string
150+
description: Filter by the Agent's status.
151+
-
152+
name: distance_address
153+
type: string
154+
description: Filter by the address.
155+
-
156+
name: distance_radius
157+
type: integer
158+
description: Filter by the radius of the address. This is used in conjunction with the `address` filter.
159+
-
160+
name: labels
161+
type: integer
162+
description: Filter by the Agent's labels.

pages/agents/agents.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
sections:
22
-
3-
title: Agent Object
4-
id: agent-object
5-
description: /agents/agent-object.md
6-
attributes: /agents/agent-object.yml
7-
response: /agents/agent-object.json
3+
title: Agent Object (Version 1)
4+
id: agent-object-v1
5+
description: /agents/agent-object-v1.md
6+
attributes: /agents/agent-object-v1.yml
7+
response: /agents/agent-object-v1.json
8+
response_title: OBJECT
9+
-
10+
title: Agent Object (Version 2)
11+
id: agent-object-v2
12+
description: /agents/agent-object-v2.md
13+
attributes: /agents/agent-object-v2.yml
14+
response: /agents/agent-object-v2.json
815
response_title: OBJECT
916
-
1017
title: List all Agents

pages/agents/create-an-agent.json

Lines changed: 30 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,32 @@
11
{
2-
"status": "success",
3-
"role": {
4-
"id": 65,
5-
"user": {
6-
"title": null,
7-
"first_name": "Billy",
8-
"last_name": "Holiday",
9-
"email": "[email protected]",
10-
"mobile": "07123 456 789",
11-
"phone": "0208 123 4567",
12-
"street": "8 Albert Road",
13-
"state": null,
14-
"town": "London",
15-
"country": "United Kingdom (GB)",
16-
"postcode": "E80 1FA",
17-
"latitude": "51.5373258999999990",
18-
"longitude": "-0.1496343000000000",
19-
"date_created": "2020-02-18T16:13:04.193340Z",
20-
"timezone": "Europe/London"
21-
},
22-
"commission_rate": null,
23-
"clients": [],
24-
"last_updated": "2020-03-16T12:23:39.056867Z",
25-
"calendar_colour": "Brown",
26-
"labels": [],
27-
"extra_attrs": [
28-
{
29-
"id": 1,
30-
"value": "1993-06-23",
31-
"type": "Date",
32-
"machine_name": "user-dob",
33-
"name": "Date of birth"
34-
}
35-
]
36-
}
2+
"id": 65,
3+
"title": null,
4+
"first_name": "Billy",
5+
"last_name": "Holiday",
6+
"email": "[email protected]",
7+
"mobile": "07123 456 789",
8+
"phone": "0208 123 4567",
9+
"street": "8 Albert Road",
10+
"state": null,
11+
"town": "London",
12+
"country": "United Kingdom (GB)",
13+
"postcode": "E80 1FA",
14+
"latitude": "51.5373258999999990",
15+
"longitude": "-0.1496343000000000",
16+
"date_created": "2020-02-18T16:13:04.193340Z",
17+
"timezone": "Europe/London",
18+
"commission_rate": null,
19+
"clients": [],
20+
"last_updated": "2020-03-16T12:23:39.056867Z",
21+
"calendar_colour": "Brown",
22+
"labels": [],
23+
"extra_attrs": [
24+
{
25+
"id": 1,
26+
"value": "1993-06-23",
27+
"type": "Date",
28+
"machine_name": "user-dob",
29+
"name": "Date of birth"
30+
}
31+
]
3732
}

pages/agents/create-an-agent.py

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,19 @@
22

33
headers = {'Authorization': 'token <API KEY>'}
44
data = {
5-
'user': {
6-
'first_name': 'Billy',
7-
'last_name': 'Bob',
8-
'email': '[email protected]',
9-
'mobile': '07123456789',
10-
'phone': '02081234567',
11-
'street': '177 South Lambeth Road',
12-
'state': None,
13-
'town': 'London',
14-
'country': 183,
15-
'postcode': 'SW8 1XP',
16-
'latitude': '51.5549',
17-
'longitude': '-0.1084',
18-
'timezone': 'Europe/London',
19-
},
5+
'first_name': 'Billy',
6+
'last_name': 'Bob',
7+
'email': '[email protected]',
8+
'mobile': '07123456789',
9+
'phone': '02081234567',
10+
'street': '177 South Lambeth Road',
11+
'state': None,
12+
'town': 'London',
13+
'country': 183,
14+
'postcode': 'SW8 1XP',
15+
'latitude': '51.5549',
16+
'longitude': '-0.1084',
17+
'timezone': 'Europe/London',
2018
'commission_rate': 10.1,
2119
'calendar_colour': 'LimeGreen',
2220
'extra_attrs': {'user_dob': '1993-06-23'},

pages/agents/get-an-agent.json

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
11
{
22
"id": 65,
3-
"user": {
4-
"title": null,
5-
"first_name": "Billy",
6-
"last_name": "Holiday",
7-
"email": "[email protected]",
8-
"mobile": "07123 456 789",
9-
"phone": "0208 123 4567",
10-
"street": "8 Albert Road",
11-
"state": null,
12-
"town": "London",
13-
"country": "United Kingdom (GB)",
14-
"postcode": "E80 1FA",
15-
"latitude": "51.5373258999999990",
16-
"longitude": "-0.1496343000000000",
17-
"date_created": "2020-02-18T16:13:04.193340Z",
18-
"timezone": "Europe/London"
19-
},
3+
"title": null,
4+
"first_name": "Billy",
5+
"last_name": "Holiday",
6+
"email": "[email protected]",
7+
"mobile": "07123 456 789",
8+
"phone": "0208 123 4567",
9+
"street": "8 Albert Road",
10+
"state": null,
11+
"town": "London",
12+
"country": "United Kingdom (GB)",
13+
"postcode": "E80 1FA",
14+
"latitude": "51.5373258999999990",
15+
"longitude": "-0.1496343000000000",
16+
"date_created": "2020-02-18T16:13:04.193340Z",
17+
"timezone": "Europe/London",
2018
"commission_rate": null,
2119
"clients": [],
2220
"last_updated": "2020-03-16T12:23:39.056867Z",

0 commit comments

Comments
 (0)