Skip to content

Commit 3291c7d

Browse files
authored
Merge pull request #196 from tutorcruncher/qualification-api-doc
Qualification levels api doc
2 parents 79ab244 + 264ed3a commit 3291c7d

14 files changed

+68
-6
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": 24,
3+
"name": "A Level",
4+
"ranking": 2.0,
5+
"custom_to_branch": true
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Create a Qualification Level
2+
3+
Creates a new Qualification Level with the given `name` and `ranking`, linked to your Branch.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pprint, requests
2+
data = {"name": "A Level", "ranking":2}
3+
headers = {'Authorization': 'token <API KEY>'}
4+
r = requests.post('https://secure.tutorcruncher.com/api/qual_levels/',json=data, headers=headers)
5+
pprint.pprint(r.json())
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
### Delete a Qualification Level
2+
Deletes a Qualification Level created by your Branch. Only the Qualification Level's unique id is required in the URL.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import pprint, requests
2+
headers = {'Authorization': 'token <API KEY>'}
3+
r = requests.delete('https://secure.tutorcruncher.com/api/qual_levels/<id>/', headers=headers)
4+
pprint.pprint(r.json())
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"id": 5,
3+
"name": "GCSE",
4+
"ranking": 14.0,
5+
"custom_to_branch": null
6+
}

pages/qual-levels/get-a-qual-level.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Get a Qualification Level
2+
3+
Returns the details of an existing Qualification Level. You only need to specify the unique
4+
`id` of the Qualification Level to get the correct details.

pages/qual-levels/get-a-qual-level.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pprint, requests
2+
3+
headers = {'Authorization': 'token <API KEY>'}
4+
r = requests.get('https://secure.tutorcruncher.com/api/qual_levels/<id>/', headers=headers)
5+
pprint.pprint(r.json())

pages/qual-levels/list-all-qual-levels.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
{
77
"id": 5,
88
"name": "GCSE",
9-
"ranking": 14.0
9+
"ranking": 14.0,
10+
"custom_to_branch": null
1011
},
1112
...
1213
]
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
### List all Qualification Levels
22

3-
Returns of all the Qualification Levels found on your TutorCruncher account sorted by their `ids` with the
4-
largest id first.
3+
Returns all Qualification Levels, sorted by `id` in descending order (highest first). Includes Qualification Levels associated with your Branch, as well as default Qualification Levels (`custom_to_branch` = null).
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"id": 6,
33
"name": "AS Level",
4-
"ranking": 15.0
4+
"ranking": 15.0,
5+
"custom_to_branch": null
56
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
### Qualification Level Object
22

3-
Qualification Level object contains the `id`, `name` and `ranking` for qualifications found on your
4-
TutorCruncher account.
3+
The Qualification Level object contains the `id`, `name`, `ranking`, and `custom_to_branch` for qualifications associated with the Branch on your TutorCruncher account.

pages/qual-levels/qual-level-object.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,7 @@ attributes:
1111
name: ranking
1212
type: decimal
1313
description: Rank for the Qualification Level.
14+
-
15+
name: custom_to_branch
16+
type: bool
17+
description: Indicates whether the Qualification Level is specific to the your Branch (True), or is a default Qualification Level (null).

pages/qual-levels/qual-levels.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,26 @@ sections:
1414
code_type: GET
1515
code_url: /api/qual_levels/
1616
response: /qual-levels/list-all-qual-levels.json
17+
-
18+
title: Get a Qualification Level
19+
id: get-a-qual-level
20+
description: /qual-levels/get-a-qual-level.md
21+
code: /qual-levels/get-a-qual-level.py
22+
code_type: GET
23+
code_url: /api/qual-levels/
24+
response: /qual-levels/get-a-qual-level.json
25+
-
26+
title: Create a Qualification Level
27+
id: create-a-qual-level
28+
description: /qual-levels/create-a-qual-level.md
29+
code: /qual-levels/create-a-qual-level.py
30+
code_type: POST
31+
code_url: /api/qual-levels/
32+
response: /qual-levels/create-a-qual-level.json
33+
-
34+
title: Delete a Qualification Level
35+
id: delete-a-qual-level
36+
description: /qual-levels/delete-a-qual-level.md
37+
code: /qual-levels/delete-a-qual-level.py
38+
code_type: POST
39+
code_url: /api/qual-levels/

0 commit comments

Comments
 (0)