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).

0 commit comments

Comments
 (0)