Skip to content

Commit 78b17a7

Browse files
committed
updated filter docs
1 parent ab291c1 commit 78b17a7

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

pages/appointments/appointment-object.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@ filters:
173173
name: recipient
174174
type: integer
175175
description: Filter by the Appointment's linked Student (id).
176+
-
177+
name: client
178+
type: integer
179+
description: Filter by the Appointment's linked Client (id).
180+
-
181+
name: status
182+
type: string
183+
description: Filter by the Appointment's status. Possible values are `planned`, `awaiting-report`, `complete`, `cancelled`, and `cancelled-chargeable`.
176184
-
177185
name: location
178186
type: integer

pages/appointments/list-all-appointments.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@
22

33
Returns a list of your Appointments. The Appointments are sorted by `id`, with
44
the largest id first.
5+
6+
You can filter appointments by client ID using the `client` parameter, and by
7+
status using the `status` parameter. Multiple filters can be combined.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
import pprint, requests
22

33
headers = {'Authorization': 'token <API KEY>'}
4+
5+
# Get all appointments
46
r = requests.get('https://secure.tutorcruncher.com/api/appointments/', headers=headers)
57
pprint.pprint(r.json())
8+
9+
# Filter by client ID
10+
r = requests.get('https://secure.tutorcruncher.com/api/appointments/?client=123', headers=headers)
11+
pprint.pprint(r.json())
12+
13+
# Filter by status
14+
r = requests.get('https://secure.tutorcruncher.com/api/appointments/?status=planned', headers=headers)
15+
pprint.pprint(r.json())
16+
17+
# Filter by both client and status
18+
r = requests.get('https://secure.tutorcruncher.com/api/appointments/?client=123&status=complete', headers=headers)
19+
pprint.pprint(r.json())

0 commit comments

Comments
 (0)