From 63e048a53af616afb5dce32513fc4d0e85c6679e Mon Sep 17 00:00:00 2001 From: Sandeep Date: Tue, 8 Apr 2025 12:57:32 +0100 Subject: [PATCH 1/6] qualification api docs --- pages/qual-levels/create-a-qual-level.json | 6 ++++++ pages/qual-levels/create-a-qual-level.md | 6 ++++++ pages/qual-levels/create-a-qual-level.py | 5 +++++ pages/qual-levels/delete-a-qual-level.md | 2 ++ pages/qual-levels/delete-a-qual-level.py | 4 ++++ pages/qual-levels/get-a-qual-level.json | 6 ++++++ pages/qual-levels/get-a-qual-level.md | 4 ++++ pages/qual-levels/get-a-qual-level.py | 5 +++++ pages/qual-levels/list-all-qual-levels.json | 3 ++- pages/qual-levels/list-all-qual-levels.md | 3 +-- pages/qual-levels/qual-level-object.json | 3 ++- pages/qual-levels/qual-level-object.md | 3 +-- pages/qual-levels/qual-level-object.yml | 4 ++++ pages/qual-levels/qual-levels.yml | 23 +++++++++++++++++++++ 14 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 pages/qual-levels/create-a-qual-level.json create mode 100644 pages/qual-levels/create-a-qual-level.md create mode 100644 pages/qual-levels/create-a-qual-level.py create mode 100644 pages/qual-levels/delete-a-qual-level.md create mode 100644 pages/qual-levels/delete-a-qual-level.py create mode 100644 pages/qual-levels/get-a-qual-level.json create mode 100644 pages/qual-levels/get-a-qual-level.md create mode 100644 pages/qual-levels/get-a-qual-level.py diff --git a/pages/qual-levels/create-a-qual-level.json b/pages/qual-levels/create-a-qual-level.json new file mode 100644 index 0000000..e7e9ede --- /dev/null +++ b/pages/qual-levels/create-a-qual-level.json @@ -0,0 +1,6 @@ +{ + "id": 24, + "name": "A Level", + "ranking": 2.0, + "custom_to_branch": true +} diff --git a/pages/qual-levels/create-a-qual-level.md b/pages/qual-levels/create-a-qual-level.md new file mode 100644 index 0000000..8148479 --- /dev/null +++ b/pages/qual-levels/create-a-qual-level.md @@ -0,0 +1,6 @@ +{ + "id": 24, + "name": "A Level", + "ranking": 20.0, + "custom_to_branch": true +} diff --git a/pages/qual-levels/create-a-qual-level.py b/pages/qual-levels/create-a-qual-level.py new file mode 100644 index 0000000..3f303f1 --- /dev/null +++ b/pages/qual-levels/create-a-qual-level.py @@ -0,0 +1,5 @@ +import pprint, requests +data = {"name": "A Level", "ranking":2} +headers = {'Authorization': 'token '} +r = requests.post('https://secure.tutorcruncher.com/api/qual_levels/',json=data, headers=headers) +pprint.pprint(r.json()) diff --git a/pages/qual-levels/delete-a-qual-level.md b/pages/qual-levels/delete-a-qual-level.md new file mode 100644 index 0000000..af72cad --- /dev/null +++ b/pages/qual-levels/delete-a-qual-level.md @@ -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. diff --git a/pages/qual-levels/delete-a-qual-level.py b/pages/qual-levels/delete-a-qual-level.py new file mode 100644 index 0000000..b2ce4b0 --- /dev/null +++ b/pages/qual-levels/delete-a-qual-level.py @@ -0,0 +1,4 @@ +import pprint, requests +headers = {'Authorization': 'token '} +r = requests.delete('https://secure.tutorcruncher.com/api/qual_levels//', headers=headers) +pprint.pprint(r.json()) diff --git a/pages/qual-levels/get-a-qual-level.json b/pages/qual-levels/get-a-qual-level.json new file mode 100644 index 0000000..48aafa7 --- /dev/null +++ b/pages/qual-levels/get-a-qual-level.json @@ -0,0 +1,6 @@ +{ + "id": 5, + "name": "GCSE", + "ranking": 14.0, + "custom_to_branch": null +} diff --git a/pages/qual-levels/get-a-qual-level.md b/pages/qual-levels/get-a-qual-level.md new file mode 100644 index 0000000..682c7b4 --- /dev/null +++ b/pages/qual-levels/get-a-qual-level.md @@ -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. diff --git a/pages/qual-levels/get-a-qual-level.py b/pages/qual-levels/get-a-qual-level.py new file mode 100644 index 0000000..f2a1a1a --- /dev/null +++ b/pages/qual-levels/get-a-qual-level.py @@ -0,0 +1,5 @@ +import pprint, requests + +headers = {'Authorization': 'token '} +r = requests.get('https://secure.tutorcruncher.com/api/qual_levels//', headers=headers) +pprint.pprint(r.json()) diff --git a/pages/qual-levels/list-all-qual-levels.json b/pages/qual-levels/list-all-qual-levels.json index 81b1b31..51de76b 100644 --- a/pages/qual-levels/list-all-qual-levels.json +++ b/pages/qual-levels/list-all-qual-levels.json @@ -6,7 +6,8 @@ { "id": 5, "name": "GCSE", - "ranking": 14.0 + "ranking": 14.0, + "custom_to_branch": null }, ... ] diff --git a/pages/qual-levels/list-all-qual-levels.md b/pages/qual-levels/list-all-qual-levels.md index c2ce52e..42a16e4 100644 --- a/pages/qual-levels/list-all-qual-levels.md +++ b/pages/qual-levels/list-all-qual-levels.md @@ -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. diff --git a/pages/qual-levels/qual-level-object.json b/pages/qual-levels/qual-level-object.json index 5e4ac0a..3dfbf63 100644 --- a/pages/qual-levels/qual-level-object.json +++ b/pages/qual-levels/qual-level-object.json @@ -1,5 +1,6 @@ { "id": 6, "name": "AS Level", - "ranking": 15.0 + "ranking": 15.0, + "custom_to_branch": null } diff --git a/pages/qual-levels/qual-level-object.md b/pages/qual-levels/qual-level-object.md index ad5670b..405e34b 100644 --- a/pages/qual-levels/qual-level-object.md +++ b/pages/qual-levels/qual-level-object.md @@ -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. diff --git a/pages/qual-levels/qual-level-object.yml b/pages/qual-levels/qual-level-object.yml index e9e310c..768a146 100644 --- a/pages/qual-levels/qual-level-object.yml +++ b/pages/qual-levels/qual-level-object.yml @@ -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). diff --git a/pages/qual-levels/qual-levels.yml b/pages/qual-levels/qual-levels.yml index f3f4c99..c0be3e7 100644 --- a/pages/qual-levels/qual-levels.yml +++ b/pages/qual-levels/qual-levels.yml @@ -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/ From c37ed6c120b8809498afb4dc028217475da50bfd Mon Sep 17 00:00:00 2001 From: Sandeep Date: Tue, 8 Apr 2025 13:07:21 +0100 Subject: [PATCH 2/6] updated doc strings --- pages/qual-levels/create-a-qual-level.md | 9 +++------ pages/qual-levels/delete-a-qual-level.md | 2 +- pages/qual-levels/list-all-qual-levels.md | 2 +- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/pages/qual-levels/create-a-qual-level.md b/pages/qual-levels/create-a-qual-level.md index 8148479..bf35196 100644 --- a/pages/qual-levels/create-a-qual-level.md +++ b/pages/qual-levels/create-a-qual-level.md @@ -1,6 +1,3 @@ -{ - "id": 24, - "name": "A Level", - "ranking": 20.0, - "custom_to_branch": true -} +### 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). diff --git a/pages/qual-levels/delete-a-qual-level.md b/pages/qual-levels/delete-a-qual-level.md index af72cad..f572c03 100644 --- a/pages/qual-levels/delete-a-qual-level.md +++ b/pages/qual-levels/delete-a-qual-level.md @@ -1,2 +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. +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. diff --git a/pages/qual-levels/list-all-qual-levels.md b/pages/qual-levels/list-all-qual-levels.md index 42a16e4..46604de 100644 --- a/pages/qual-levels/list-all-qual-levels.md +++ b/pages/qual-levels/list-all-qual-levels.md @@ -1,3 +1,3 @@ ### List all Qualification Levels -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. +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. From de4deeaf867b6bc7db8dd7bbfede2d57064de3b6 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 14:42:25 +0100 Subject: [PATCH 3/6] dan comments --- pages/qual-levels/create-a-qual-level.md | 2 +- pages/qual-levels/delete-a-qual-level.md | 2 +- pages/qual-levels/qual-level-object.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/qual-levels/create-a-qual-level.md b/pages/qual-levels/create-a-qual-level.md index bf35196..18ef025 100644 --- a/pages/qual-levels/create-a-qual-level.md +++ b/pages/qual-levels/create-a-qual-level.md @@ -1,3 +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). +Creates a new Qualification Level with the given `name` and `ranking`, linked to your Branch. diff --git a/pages/qual-levels/delete-a-qual-level.md b/pages/qual-levels/delete-a-qual-level.md index f572c03..5028e24 100644 --- a/pages/qual-levels/delete-a-qual-level.md +++ b/pages/qual-levels/delete-a-qual-level.md @@ -1,2 +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. +Deletes a Qualification Level created by your Branch. Only the Qualification Level's unique id is required in the URL. diff --git a/pages/qual-levels/qual-level-object.yml b/pages/qual-levels/qual-level-object.yml index 768a146..a45c766 100644 --- a/pages/qual-levels/qual-level-object.yml +++ b/pages/qual-levels/qual-level-object.yml @@ -14,4 +14,4 @@ attributes: - 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). + description: Indicates whether the Qualification Level is specific to the your Branch (True), or shared across all Branches (null). From fb1c80f5ce61b9a453b675e4b33d35b5de4130af Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 16:40:35 +0100 Subject: [PATCH 4/6] henrys comment --- pages/qual-levels/list-all-qual-levels.md | 2 +- pages/qual-levels/qual-level-object.md | 2 +- pages/qual-levels/qual-level-object.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/qual-levels/list-all-qual-levels.md b/pages/qual-levels/list-all-qual-levels.md index 46604de..dee416c 100644 --- a/pages/qual-levels/list-all-qual-levels.md +++ b/pages/qual-levels/list-all-qual-levels.md @@ -1,3 +1,3 @@ ### List all Qualification Levels -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. +Returns all Qualification Levels, sorted by `id` in descending order (highest first). Includes Qualification Levels associated with your Branch, as well as unassigned Qualification Levels (`custom_to_branch` = null). diff --git a/pages/qual-levels/qual-level-object.md b/pages/qual-levels/qual-level-object.md index 405e34b..d2f32ca 100644 --- a/pages/qual-levels/qual-level-object.md +++ b/pages/qual-levels/qual-level-object.md @@ -1,3 +1,3 @@ ### Qualification Level Object -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. +The Qualification Level object contains the `id`, `name`, `ranking`, and `custom_to_branch` for qualifications associated with the Branch on your TutorCruncher account. diff --git a/pages/qual-levels/qual-level-object.yml b/pages/qual-levels/qual-level-object.yml index a45c766..7f50413 100644 --- a/pages/qual-levels/qual-level-object.yml +++ b/pages/qual-levels/qual-level-object.yml @@ -14,4 +14,4 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Qualification Level is specific to the your Branch (True), or shared across all Branches (null). + description: Indicates whether the Qualification Level is specific to the your Branch (True), or is a default subject (null). From 3f92413de83778e8c348b064573b3851f02e53a5 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 16:48:40 +0100 Subject: [PATCH 5/6] henrys comment --- pages/qual-levels/list-all-qual-levels.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/qual-levels/list-all-qual-levels.md b/pages/qual-levels/list-all-qual-levels.md index dee416c..66d0da1 100644 --- a/pages/qual-levels/list-all-qual-levels.md +++ b/pages/qual-levels/list-all-qual-levels.md @@ -1,3 +1,3 @@ ### List all Qualification Levels -Returns all Qualification Levels, sorted by `id` in descending order (highest first). Includes Qualification Levels associated with your Branch, as well as unassigned Qualification Levels (`custom_to_branch` = null). +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). From aef3ca4fc8ff60e55cb01bdedff0b0c87213c6da Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 17:00:27 +0100 Subject: [PATCH 6/6] update the qual_level descritpions --- pages/qual-levels/qual-level-object.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/qual-levels/qual-level-object.yml b/pages/qual-levels/qual-level-object.yml index 7f50413..9737ed3 100644 --- a/pages/qual-levels/qual-level-object.yml +++ b/pages/qual-levels/qual-level-object.yml @@ -14,4 +14,4 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Qualification Level is specific to the your Branch (True), or is a default subject (null). + description: Indicates whether the Qualification Level is specific to the your Branch (True), or is a default Qualification Level (null).