Assignments
Get an assignment
GET
/
assignments
/
{assignmentId}
Get an assignment
curl --request GET \
--url https://trainertwin.com/api/v1/assignments/{assignmentId} \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://trainertwin.com/api/v1/assignments/{assignmentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://trainertwin.com/api/v1/assignments/{assignmentId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"assignment": {
"id": "assignment_123",
"assignedAt": "2023-11-07T05:31:56Z",
"user": {
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com"
},
"scenario": {
"slug": "react-mock-interview",
"name": "React mock interview",
"version": 3,
"visibility": "public"
}
}
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}⌘I
Get an assignment
curl --request GET \
--url https://trainertwin.com/api/v1/assignments/{assignmentId} \
--header 'x-api-key: <api-key>'const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://trainertwin.com/api/v1/assignments/{assignmentId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://trainertwin.com/api/v1/assignments/{assignmentId}"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text){
"assignment": {
"id": "assignment_123",
"assignedAt": "2023-11-07T05:31:56Z",
"user": {
"id": "<string>",
"name": "<string>",
"email": "jsmith@example.com"
},
"scenario": {
"slug": "react-mock-interview",
"name": "React mock interview",
"version": 3,
"visibility": "public"
}
}
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}{
"error": "Resource not found"
}