Skip to content

Commit 44df4e6

Browse files
authored
Merge pull request #199 from tutorcruncher/subject-cat-endpoint
Add subject cat docs
2 parents d369df9 + 67abb26 commit 44df4e6

12 files changed

+96
-1
lines changed

data/actions.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -914,6 +914,14 @@
914914
"Application"
915915
]
916916
},
917+
{
918+
"key": "EXPORTED_TENDERS",
919+
"value": "EXPORTED_TENDERS",
920+
"msg": "Exported Job Applications",
921+
"help_text": "When an admin exports Job Applications.",
922+
"extra_msg": "",
923+
"subject_types": []
924+
},
917925
{
918926
"key": "CREATED_AN_APPOINTMENT",
919927
"value": "CREATED_AN_APPOINTMENT",
@@ -1732,7 +1740,15 @@
17321740
"key": "DELETED_A_REVIEW",
17331741
"value": "DELETED_A_REVIEW",
17341742
"msg": "Deleted a Review",
1735-
"help_text": "When an Administrator deletes a Client's Reivew.",
1743+
"help_text": "When an Administrator deletes a Client's Review.",
1744+
"extra_msg": "",
1745+
"subject_types": []
1746+
},
1747+
{
1748+
"key": "EXPORTED_REVIEWS",
1749+
"value": "EXPORTED_REVIEWS",
1750+
"msg": "Exported Reviews",
1751+
"help_text": "When an Administrator exports Reviews",
17361752
"extra_msg": "",
17371753
"subject_types": []
17381754
},

pages/api.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ endpoint_sections:
130130
title: Subjects
131131
id: subjects
132132
layout: /subjects/subjects.yml
133+
-
134+
title: Subject Categories
135+
id: subject-categories
136+
layout: /subject-categories/subject-categories.yml
133137
-
134138
title: Tasks
135139
id: tasks
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"id": 51,
3+
"name": "Science"
4+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### Get a Subject Category
2+
3+
Returns the details of an existing subject category. You only need to specify the unique `id` of the Subject Category to get the correct details.
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/countries/<id>/', headers=headers)
5+
pprint.pprint(r.json())
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"count": 2,
3+
"next": null,
4+
"previous": null,
5+
"results": [
6+
{
7+
"id": 50,
8+
"name": "Maths"
9+
},
10+
{
11+
"id": 51,
12+
"name": "Science"
13+
}
14+
]
15+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### List all Subject Categories
2+
3+
Returns of all the Subject Categories found on your TutorCruncher account, which are sorted by `id`.
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/subject_categories/', headers=headers)
5+
pprint.pprint(r.json())
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
sections:
2+
-
3+
title: Subject Category Object
4+
id: subject-category-object
5+
description: /subject-categories/subject-category.md
6+
attributes: /subject-categories/subject-category.yml
7+
response: /subject-categories/subject-category.json
8+
response_title: OBJECT
9+
-
10+
title: List all Subject Categories
11+
id: list-all-subject-categories
12+
description: /subject-categories/list-all-subject-categories.md
13+
code: /subject-categories/list-all-subject-categories.py
14+
code_type: GET
15+
code_url: /api/subject-categories/
16+
response: /subject-categories/list-all-subject-categories.json
17+
-
18+
title: Get a Subject Category
19+
id: get-a-subject-category
20+
description: /subject-categories/get-a-subject-category.md
21+
code: /subject-categories/get-a-subject-category.py
22+
code_type: GET
23+
code_url: /api/subject-categories/<id>/
24+
response: /subject-categories/get-a-subject-category.json
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"id": 51,
3+
"name": "Science"
4+
}

0 commit comments

Comments
 (0)