Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 6 additions & 0 deletions pages/qual-levels/create-a-qual-level.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": 24,
"name": "A Level",
"ranking": 2.0,
"custom_to_branch": true
}
3 changes: 3 additions & 0 deletions pages/qual-levels/create-a-qual-level.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Create a Qualification Level

Creates a new Qualification Level with the given `name` and `ranking`, linked to the API key's Branch (`custom_to_branch`=True).
5 changes: 5 additions & 0 deletions pages/qual-levels/create-a-qual-level.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pprint, requests
data = {"name": "A Level", "ranking":2}
headers = {'Authorization': 'token <API KEY>'}
r = requests.post('https://secure.tutorcruncher.com/api/qual_levels/',json=data, headers=headers)
pprint.pprint(r.json())
2 changes: 2 additions & 0 deletions pages/qual-levels/delete-a-qual-level.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Delete a Qualification Level
Deletes a Qualification Level created by the API key's Branch (`custom_to_branch`=True). Only the Qualification Level's unique id is required in the URL. Qualification Levels not created by the API key's Branch cannot be deleted.
4 changes: 4 additions & 0 deletions pages/qual-levels/delete-a-qual-level.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import pprint, requests
headers = {'Authorization': 'token <API KEY>'}
r = requests.delete('https://secure.tutorcruncher.com/api/qual_levels/<id>/', headers=headers)
pprint.pprint(r.json())
6 changes: 6 additions & 0 deletions pages/qual-levels/get-a-qual-level.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"id": 5,
"name": "GCSE",
"ranking": 14.0,
"custom_to_branch": null
}
4 changes: 4 additions & 0 deletions pages/qual-levels/get-a-qual-level.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Get a Qualification Level

Returns the details of an existing Qualification Level. You only need to specify the unique
`id` of the Qualification Level to get the correct details.
5 changes: 5 additions & 0 deletions pages/qual-levels/get-a-qual-level.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
r = requests.get('https://secure.tutorcruncher.com/api/qual_levels/<id>/', headers=headers)
pprint.pprint(r.json())
3 changes: 2 additions & 1 deletion pages/qual-levels/list-all-qual-levels.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
{
"id": 5,
"name": "GCSE",
"ranking": 14.0
"ranking": 14.0,
"custom_to_branch": null
},
...
]
Expand Down
3 changes: 1 addition & 2 deletions pages/qual-levels/list-all-qual-levels.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
### List all Qualification Levels

Returns of all the Qualification Levels found on your TutorCruncher account sorted by their `ids` with the
largest id first.
Returns all Qualification Levels, sorted by `id` in descending order (highest first). Includes Qualification Levels associated with the API key's Branch, as well as unassigned Qualification Levels (`custom_to_branch` = null). Qualification Levels linked to other Branches or marked as hidden for the API key's Branch are excluded.
3 changes: 2 additions & 1 deletion pages/qual-levels/qual-level-object.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": 6,
"name": "AS Level",
"ranking": 15.0
"ranking": 15.0,
"custom_to_branch": null
}
3 changes: 1 addition & 2 deletions pages/qual-levels/qual-level-object.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
### Qualification Level Object

Qualification Level object contains the `id`, `name` and `ranking` for qualifications found on your
TutorCruncher account.
The Qualification Level object contains the `id`, `name`, `ranking`, and `custom_to_branch` for qualifications associated with the API key's Branch on your TutorCruncher account.
4 changes: 4 additions & 0 deletions pages/qual-levels/qual-level-object.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ attributes:
name: ranking
type: decimal
description: Rank for the Qualification Level.
-
name: custom_to_branch
type: bool
description: Indicates whether the Qualification Level is specific to the API key's Branch (True), or shared across all Branches (null).
23 changes: 23 additions & 0 deletions pages/qual-levels/qual-levels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,26 @@ sections:
code_type: GET
code_url: /api/qual_levels/
response: /qual-levels/list-all-qual-levels.json
-
title: Get a Qualification Level
id: get-a-qual-level
description: /qual-levels/get-a-qual-level.md
code: /qual-levels/get-a-qual-level.py
code_type: GET
code_url: /api/qual-levels/
response: /qual-levels/get-a-qual-level.json
-
title: Create a Qualification Level
id: create-a-qual-level
description: /qual-levels/create-a-qual-level.md
code: /qual-levels/create-a-qual-level.py
code_type: POST
code_url: /api/qual-levels/
response: /qual-levels/create-a-qual-level.json
-
title: Delete a Qualification Level
id: delete-a-qual-level
description: /qual-levels/delete-a-qual-level.md
code: /qual-levels/delete-a-qual-level.py
code_type: POST
code_url: /api/qual-levels/