PUT test-result/…
Submits a completed test.
Submitting a test is only required for navigable tests. Non-navigable tests are submitted automatically upon answering the last question.
Resource URL
https://www.drillster.com/api/2.1/test-result/{test_id}
or
https://www.drillster.com/api/2.1/test-result/{test_id}/{user_id}
or
https://www.drillster.com/api/2.1/test-result/{test_id}/{ticket}
Parameters
Field | Type | Description |
---|---|---|
test_id required |
String | The ID of the test definition. This defines the test itself, not the individual instances done by users. Example value: 7OuHq7RcQOCsnGWR58TnBw |
user_id optional |
String | The user ID of the user to submit test details for. If omitted, the details for the own user account are returned. Example value: j7Yvq-ynQeWNnHTNWRV9wA |
ticket optional |
String | A ticket number issued by Drillster for use with anonymous tests. Example value: jK8TJ11kcA7YvqUhd873kJ Either a user ID or a test ticket can be used, not both! |
💡 Good to know
If a PUT request has no body (i.e. the body is empty), it is still mandatory to include a Content-Length header (i.e.
Content-Length: 0
). Not all HTTP clients do this automatically. For more information, please see 🔗 RFC 2616
Response
An empty object.
Example request
PUT https://www.drillster.com/api/2.1/test-result/HmOZ3fMbRxulVH77XYR8nQ/GNiyJoCtRTyQmmy-P9xlfA
Response
{}
Error responses
The following error situations are possible:
ID | Response code | Description |
---|---|---|
not_found |
404 (Not found) | Requested test result not found. |
invalid_test_type |
400 (Bad request) | The test cannot be completed manually, because is does not allow question navigation. |
already_completed |
400 (Bad request) | The test was already completed. |
not_all_questions_answered |
400 (Bad request) | Not all questions have been answered and submitting a non-completed test is not allowed in this case. |