-
Notifications
You must be signed in to change notification settings - Fork 0
Contractor Skill API Doc #194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
d094417
contractors skill docs
Pager07 9228c22
updated the custom_to_branch description
Pager07 222457d
updated doc strings
Pager07 701e040
updated role v2 objects to reflect new skills objects
Pager07 2c286ff
dan comments
Pager07 8d32f53
dan comments
Pager07 ca8bd02
dan comments
Pager07 66ffe63
henrys comment about duplication
Pager07 9dc98ed
extra changes
Pager07 b0ef416
updated the url string
Pager07 460c1f0
updated the url string
Pager07 2a21a3f
update the qual_level descritpions
Pager07 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"id": 2, | ||
"contractor": { | ||
"id": 52, | ||
"first_name": "James", | ||
"last_name": "Higgins", | ||
"email": "[email protected]", | ||
"url": "http://localhost:8000/api/contractors/52/" | ||
}, | ||
"subject": { | ||
"id": 159, | ||
"name": "PGCE", | ||
"category_id": 15, | ||
"category_name": "Teaching Skill", | ||
"custom_to_branch": null | ||
}, | ||
"qual_level": { | ||
"id": 14, | ||
"name": "BA", | ||
"ranking": 50.0, | ||
"custom_to_branch": null | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
### Contractor Skills Object | ||
|
||
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. | ||
|
||
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. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
attributes: | ||
- | ||
name: id | ||
type: integer | ||
description: Unique identifier for the contractor skill object. | ||
- | ||
name: contractor | ||
type: object | ||
description: The contractor this skill is associated with. | ||
children: | ||
- | ||
name: id | ||
type: integer | ||
description: Unique identifier for the contractor. | ||
- | ||
name: first_name | ||
type: string | ||
description: The contractor's first name. | ||
- | ||
name: last_name | ||
type: string | ||
description: The contractor's last name. | ||
- | ||
name: email | ||
type: string | ||
description: The contractor's email address. | ||
- | ||
name: url | ||
type: string | ||
description: API URL for the full contractor details. | ||
- | ||
name: subject | ||
type: object | ||
description: The subject details. | ||
children: | ||
- | ||
name: id | ||
type: integer | ||
description: Unique identifier for the subject. | ||
- | ||
name: name | ||
type: string | ||
description: Name of the subject. | ||
- | ||
name: category_id | ||
type: integer | ||
description: ID of the subject category. | ||
- | ||
name: category_name | ||
type: string | ||
description: Name of the subject category. | ||
- | ||
name: custom_to_branch | ||
type: bool | ||
description: Indicates whether the Subject is custom to the API key's Branch (True), or shared across all Branches (null). | ||
- | ||
name: qual_level | ||
type: object | ||
description: The qualification level details. | ||
children: | ||
- | ||
name: id | ||
type: integer | ||
description: Unique identifier for the qualification level. | ||
- | ||
name: name | ||
type: string | ||
description: Name of the qualification level. | ||
- | ||
name: ranking | ||
type: decimal | ||
description: Numerical ranking of the qualification level. | ||
- | ||
name: custom_to_branch | ||
type: bool | ||
description: Indicates whether the Qualification Level is custom to the API key's Branch (True), or shared across all Branches (null). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
sections: | ||
- | ||
title: Contractor Skills Object | ||
id: contractor-skills-object | ||
description: /contractor-skills/contractor-skills-object.md | ||
attributes: /contractor-skills/contractor-skills-object.yml | ||
response: /contractor-skills/contractor-skills-object.json | ||
response_title: OBJECT | ||
- | ||
title: List all Contractor Skills | ||
id: list-all-contractor-skills | ||
description: /contractor-skills/list-all-contractor-skills.md | ||
code: /contractor-skills/list-all-contractor-skills.py | ||
code_type: GET | ||
code_url: /api/contractor-skills/ | ||
response: /contractor-skills/list-all-contractor-skills.json | ||
- | ||
title: Get a Contractor Skill | ||
id: get-a-contractor-skill | ||
description: /contractor-skills/get-a-contractor-skill.md | ||
code: /contractor-skills/get-a-contractor-skill.py | ||
code_type: GET | ||
code_url: /api/contractor-skills/<id>/ | ||
response: /contractor-skills/get-a-contractor-skill.json | ||
- | ||
title: Create a Contractor Skill | ||
id: create-a-contractor-skills | ||
description: /contractor-skills/create-a-contractor-skill.md | ||
code: /contractor-skills/create-a-contractor-skill.py | ||
code_type: POST | ||
code_url: /api/contractor-skills/ | ||
response: /contractor-skills/create-a-contractor-skill.json | ||
- | ||
Comment on lines
+26
to
+33
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is there an update? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we don't allow for it. |
||
title: Delete a Contractor Skill | ||
id: delete-a-contractor-skill | ||
description: /contractor-skills/delete-a-contractor-skill.md | ||
code: /contractor-skills/delete-a-contractor-skill.py | ||
code_type: DELETE | ||
code_url: /api/contractor-skills/<id>/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"id": 135, | ||
"contractor": { | ||
"id": 69, | ||
"first_name": "Billy", | ||
"last_name": "Holiday", | ||
"email": null, | ||
"url": "http://localhost:8000/api/contractors/69/" | ||
}, | ||
"subject": { | ||
"id": 51, | ||
"name": "Religious Studies", | ||
"category_id": 8, | ||
"category_name": "Humanities", | ||
"custom_to_branch": null | ||
}, | ||
"qual_level": { | ||
"id": 13, | ||
"name": "Key Stage 5", | ||
"ranking": 35.0, | ||
"custom_to_branch": null | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Add a Contractor Skill | ||
|
||
Creates a new Contractor Skill, representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). You need to provide the `contractor`, `subject`, and `qual_level` IDs in the request body. Subjects or Qualification Levels custom to another branch, hidden for the branch, or added specifically by the Contractor cannot be used. For more information about what “custom to branch” means, see [Subject](#subjects) and [Qualification Level](#qual-levels). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import pprint, requests | ||
data = {"contractor": 69,"subject": 51,"qual_level": 13} | ||
headers = {'Authorization': 'token <API KEY>'} | ||
r = requests.post('https://secure.tutorcruncher.com/api/contractor-skills/',json=data, headers=headers) | ||
pprint.pprint(r.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Delete a Contractor Skill | ||
|
||
Deletes a Contractor Skill using its unique ID. Only Contractor Skills associated with the API key's Branch can be deleted. Attempts to delete a skill that belongs to a different Branch or references a Subject or Qualification Level hidden or restricted for the Branch will result in a `400 Bad Request` response. For more information about Branch-specific restrictions, see [Subject](#subjects) and [Qualification Level](#qual-levels). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import pprint, requests | ||
|
||
headers = {'Authorization': 'token <API KEY>'} | ||
r = requests.delete('https://secure.tutorcruncher.com/api/contractor-skills/1/', headers=headers) | ||
# Returns 204 on success |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"id": 2, | ||
"contractor": { | ||
"id": 52, | ||
"first_name": "James", | ||
"last_name": "Higgins", | ||
"email": "[email protected]", | ||
"url": "https://secure.tutorcruncher.com/api/contractors/52/" | ||
}, | ||
"subject": { | ||
"id": 159, | ||
"name": "PGCE", | ||
"category_id": 15, | ||
"category_name": "Teaching Skill", | ||
"custom_to_branch": null | ||
}, | ||
"qual_level": { | ||
"id": 14, | ||
"name": "BA", | ||
"ranking": 50.0, | ||
"custom_to_branch": null | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
### Get a Contractor Skill | ||
|
||
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. | ||
The response includes the full Contractor Skill object including the Contractor details, [Subject](#subjects) and [Qualification Level](#qual-level). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/contractor-skills/2/', headers=headers) | ||
pprint.pprint(r.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"count": 2, | ||
"next": null, | ||
"previous": null, | ||
"results": [ | ||
{ | ||
"id": 2, | ||
"contractor": { | ||
"id": 52, | ||
"first_name": "James", | ||
"last_name": "Higgins", | ||
"email": "[email protected]", | ||
"url": "https://secure.tutorcruncher.com/api/contractors/52/" | ||
}, | ||
"subject": { | ||
"id": 159, | ||
"name": "PGCE", | ||
"category_id": 15, | ||
"category_name": "Teaching Skill", | ||
"custom_to_branch": null | ||
}, | ||
"qual_level": { | ||
"id": 14, | ||
"name": "BA", | ||
"ranking": 50.0, | ||
"custom_to_branch": null | ||
} | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### List all Contractor Skills | ||
Returns a list of Contractor Skills, each representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). The results include only skills that are custom to the API key's Branch, exclude skills with hidden Subjects or Qualification Levels for the Branch, and include skills specifically added by the Contractor. If no skills match the filtering criteria, the response will return an empty results array. For more information about what "custom to branch" means, see [Subject](#subjects) and [Qualification Level](#qual-levels). | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/contractor-skills/', headers=headers) | ||
pprint.pprint(r.json()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,15 +20,51 @@ | |
"qualifications": [], | ||
"skills": [ | ||
{ | ||
"id": 1436, | ||
"subject": "American Studies", | ||
"qual_level": "Key Stage 5" | ||
}, | ||
"id": 145, | ||
"contractor": { | ||
"id": 568433, | ||
"first_name": "James", | ||
"last_name": "Higgins", | ||
"email": "[email protected]", | ||
"url": "https://secure.tutorcruncher.com/api/568433/" | ||
}, | ||
"subject": { | ||
"id": 98, | ||
"name": "General Maths & Science", | ||
"category_id": 11, | ||
"category_name": "Other", | ||
"custom_to_branch": null | ||
}, | ||
"qual_level": { | ||
"id": 3, | ||
"name": "Common Entrance", | ||
"ranking": 12.0, | ||
"custom_to_branch": null | ||
} | ||
}, | ||
{ | ||
"id": 4082, | ||
"subject": "American Studies", | ||
"qual_level": "A Level" | ||
} | ||
"id": 141, | ||
"contractor": { | ||
"id": 568433, | ||
"first_name": "James", | ||
"last_name": "Higgins", | ||
"email": "[email protected]", | ||
"url": "https://secure.tutorcruncher.com/api/568433/" | ||
}, | ||
"subject": { | ||
"id": 135, | ||
"name": "Geology", | ||
"category_id": 14, | ||
"category_name": "Science", | ||
"custom_to_branch": null | ||
}, | ||
"qual_level": { | ||
"id": 5, | ||
"name": "GCSE", | ||
"ranking": 14.0, | ||
"custom_to_branch": null | ||
} | ||
} | ||
], | ||
"institutions": [], | ||
"receive_service_notifications": true, | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.