Skip to content

Commit d094417

Browse files
committed
contractors skill docs
1 parent 61b9469 commit d094417

16 files changed

+274
-0
lines changed

pages/api.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,10 @@ endpoint_sections:
6666
title: Contractors (Tutors)
6767
id: contractors
6868
layout: /contractors/contractors.yml
69+
-
70+
title: Contractor Skills
71+
id: contractor-skills
72+
layout: /contractor-skills/contractor-skills.yml
6973
-
7074
title: Countries
7175
id: countries
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": 2,
3+
"contractor": {
4+
"id": 52,
5+
"first_name": "James",
6+
"last_name": "Higgins",
7+
"email": "[email protected]",
8+
"url": "http://localhost:8000/api/contractors/52/"
9+
},
10+
"subject": {
11+
"id": 159,
12+
"name": "PGCE",
13+
"category_id": 15,
14+
"category_name": "Teaching Skill",
15+
"custom_to_branch": null
16+
},
17+
"qual_level": {
18+
"id": 14,
19+
"name": "BA",
20+
"ranking": 50.0,
21+
"custom_to_branch": null
22+
}
23+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Contractor Skills Object
2+
3+
A Contractor Skills object represents the relationship between a Contractor and a Skill. A Skill is defined by a combination of a [Subject](#subjects) and a [Qualification Level](#qual-level). For example, a Skill might be "Mathematics (A Level)" where "Mathematics" is the Subject and "A Level" is the Qualification Level.
4+
5+
When you retrieve a Contractor Skill, you'll get the full details of the Contractor, along with the associated Subject and Qualification Level information. This allows you to see not just which skills a Contractor has, but also the specific Qualification Levels for each subject they can teach.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
attributes:
2+
-
3+
name: id
4+
type: integer
5+
description: Unique identifier for the contractor skill object.
6+
-
7+
name: contractor
8+
type: object
9+
description: The contractor this skill is associated with.
10+
children:
11+
-
12+
name: id
13+
type: integer
14+
description: Unique identifier for the contractor.
15+
-
16+
name: first_name
17+
type: string
18+
description: The contractor's first name.
19+
-
20+
name: last_name
21+
type: string
22+
description: The contractor's last name.
23+
-
24+
name: email
25+
type: string
26+
description: The contractor's email address.
27+
-
28+
name: url
29+
type: string
30+
description: API URL for the full contractor details.
31+
-
32+
name: subject
33+
type: object
34+
description: The subject/skill details.
35+
children:
36+
-
37+
name: id
38+
type: integer
39+
description: Unique identifier for the subject.
40+
-
41+
name: name
42+
type: string
43+
description: Name of the subject.
44+
-
45+
name: category_id
46+
type: integer
47+
description: ID of the subject category.
48+
-
49+
name: category_name
50+
type: string
51+
description: Name of the subject category.
52+
-
53+
name: custom_to_branch
54+
type: integer
55+
description: Branch ID if subject is custom to a branch, null otherwise.
56+
-
57+
name: qual_level
58+
type: object
59+
description: The qualification level details.
60+
children:
61+
-
62+
name: id
63+
type: integer
64+
description: Unique identifier for the qualification level.
65+
-
66+
name: name
67+
type: string
68+
description: Name of the qualification level.
69+
-
70+
name: ranking
71+
type: decimal
72+
description: Numerical ranking of the qualification level.
73+
-
74+
name: custom_to_branch
75+
type: integer
76+
description: Branch ID if qualification level is custom to a branch, null otherwise.
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
sections:
2+
-
3+
title: Contractor Skills Object
4+
id: contractor-skills-object
5+
description: /contractor-skills/contractor-skills-object.md
6+
attributes: /contractor-skills/contractor-skills-object.yml
7+
response: /contractor-skills/contractor-skills-object.json
8+
response_title: OBJECT
9+
-
10+
title: List all Contractor Skills
11+
id: list-all-contractor-skills
12+
description: /contractor-skills/list-all-contractor-skills.md
13+
code: /contractor-skills/list-all-contractor-skills.py
14+
code_type: GET
15+
code_url: /api/contractor-skills/
16+
response: /contractor-skills/list-all-contractor-skills.json
17+
-
18+
title: Get a Contractor Skill
19+
id: get-a-contractor-skill
20+
description: /contractor-skills/get-a-contractor-skill.md
21+
code: /contractor-skills/get-a-contractor-skill.py
22+
code_type: GET
23+
code_url: /api/contractor-skills/<id>/
24+
response: /contractor-skills/get-a-contractor-skill.json
25+
-
26+
title: Create a Contractor Skill
27+
id: skill-add-to-a-contractor
28+
description: /contractor-skills/skill-add-to-a-contractor.md
29+
code: /contractor-skills/skill-add-to-a-contractor.py
30+
code_type: POST
31+
code_url: /api/contractor-skills/
32+
response: /contractor-skills/skill-add-to-a-contractor.json
33+
-
34+
title: Delete a Contractor Skill
35+
id: delete-a-contractor-skill
36+
description: /contractor-skills/delete-a-contractor-skill.md
37+
code: /contractor-skills/delete-a-contractor-skill.py
38+
code_type: DELETE
39+
code_url: /api/contractor-skills/<id>/
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
### Delete a Contractor Skill
2+
3+
Deletes an existing Contractor Skill. You only need to specify the unique `id` of the Contractor Skill.
4+
5+
If the specified Contractor Skill ID does not exist, a 404 response will be returned.
6+
7+
A successful deletion returns a 204 response with no content.
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.delete('https://secure.tutorcruncher.com/api/contractor-skills/1/', headers=headers)
5+
# Returns 204 on success
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"id": 2,
3+
"contractor": {
4+
"id": 52,
5+
"first_name": "James",
6+
"last_name": "Higgins",
7+
"email": "[email protected]",
8+
"url": "https://secure.tutorcruncher.com/api/contractors/52/"
9+
},
10+
"subject": {
11+
"id": 159,
12+
"name": "PGCE",
13+
"category_id": 15,
14+
"category_name": "Teaching Skill",
15+
"custom_to_branch": null
16+
},
17+
"qual_level": {
18+
"id": 14,
19+
"name": "BA",
20+
"ranking": 50.0,
21+
"custom_to_branch": null
22+
}
23+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Get a Contractor Skill
2+
3+
Returns the details of an existing Contractor Skill. You only need to specify the unique `id` of the Contractor Skill to get the correct details.
4+
5+
The response includes the full Contractor Skill object including the Contractor details, [Subject](#subjects) and [Qualification Level](#qual-level).
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/contractor-skills/2/', headers=headers)
5+
pprint.pprint(r.json())

0 commit comments

Comments
 (0)