Attempts

Attempts API gives you access to read all the attempts which can be accessed by the authenticated user.

Get All Attempts

This endpoint retrieves all attempts for the authenticated user.

HTTP Request

GET /api/v2.2/attempts/

Query Parameters

Parameter

Type

Description

course

string

Filters by course name. Ex: IBPS

q

string

Filters by exam title. Useful to search by exam title.

cURL
Ruby
Python
C#
PHP
Java
NodeJS
Go
cURL
curl --request GET \
--url http://demo.testpress.in/api/v2.2/attempts/ \
--header 'authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw' \
--header 'cache-control: no-cache'

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125894/",
"id": 125894,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/forum-ias-rbi-demo/",
"id": 3720,
"title": "FORUM IAS RBI DEMO",
"description": "",
"course": "TNPSC",
"start_date": "2.25-11-07T12:37:11+05:30",
"end_date": "2.25-11-15T12:37:11+05:30",
"duration": "3:00:00",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 2,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": false,
"rank_publishing_date": null,
"allow_pdf": false,
"created": "2.25-11-07T07:07:41.597Z",
"slug": "forum-ias-rbi-demo",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T07:12:49.873Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125894/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125894/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T08:02:46.845Z",
"remaining_time": "2.20:03",
"time_taken": "0:49:57",
"state": "Running",
"rank": "NA",
"max_rank": 0,
"percentage": "0",
"unanswered_count": 0,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125872/",
"id": 125872,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/aiims-exam/",
"id": 3625,
"title": "AIIMS Exam",
"description": "",
"course": "TNPSC",
"start_date": "2.25-10-20T18:12:26+05:30",
"end_date": null,
"duration": "3:12:27",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 3,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": true,
"rank_publishing_date": "2.25-10-20T12:42:44Z",
"allow_pdf": false,
"created": "2.25-10-20T12:43:01.684Z",
"slug": "aiims-exam",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T06:17:42.313Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125872/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125872/questions/",
"percentile": 60,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T06:17:42.375Z",
"remaining_time": "3:12:26",
"time_taken": "0:00:01",
"state": "Completed",
"rank": 4,
"max_rank": 5,
"percentage": "0",
"unanswered_count": 200,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
}
]
}

This endpoint retrieves all attempts for the authenticated user.

HTTP Request

GET /api/v2.2/attempts/

Query Parameters

Parameter

Type

Description

course

string

Filters by course name. Ex: IBPS

q

string

Filters by exam title. Useful to search by exam title.

Ruby
require 'uri'
require 'net/http'
url = URI("http://demo.testpress.in/api/v2.2/attempts/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["authorization"] = 'JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125894/",
"id": 125894,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/forum-ias-rbi-demo/",
"id": 3720,
"title": "FORUM IAS RBI DEMO",
"description": "",
"course": "TNPSC",
"start_date": "2.25-11-07T12:37:11+05:30",
"end_date": "2.25-11-15T12:37:11+05:30",
"duration": "3:00:00",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 2,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": false,
"rank_publishing_date": null,
"allow_pdf": false,
"created": "2.25-11-07T07:07:41.597Z",
"slug": "forum-ias-rbi-demo",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T07:12:49.873Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125894/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125894/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T08:02:46.845Z",
"remaining_time": "2.20:03",
"time_taken": "0:49:57",
"state": "Running",
"rank": "NA",
"max_rank": 0,
"percentage": "0",
"unanswered_count": 0,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125872/",
"id": 125872,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/aiims-exam/",
"id": 3625,
"title": "AIIMS Exam",
"description": "",
"course": "TNPSC",
"start_date": "2.25-10-20T18:12:26+05:30",
"end_date": null,
"duration": "3:12:27",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 3,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": true,
"rank_publishing_date": "2.25-10-20T12:42:44Z",
"allow_pdf": false,
"created": "2.25-10-20T12:43:01.684Z",
"slug": "aiims-exam",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T06:17:42.313Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125872/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125872/questions/",
"percentile": 60,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T06:17:42.375Z",
"remaining_time": "3:12:26",
"time_taken": "0:00:01",
"state": "Completed",
"rank": 4,
"max_rank": 5,
"percentage": "0",
"unanswered_count": 200,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
}
]
}
Python
import requests
url = "http://demo.testpress.in/api/v2.2/attempts/"
headers = {
'authorization': "JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw",
'cache-control': "no-cache",
}
response = requests.request("GET", url, headers=headers)
print(response.text)

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125894/",
"id": 125894,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/forum-ias-rbi-demo/",
"id": 3720,
"title": "FORUM IAS RBI DEMO",
"description": "",
"course": "TNPSC",
"start_date": "2.25-11-07T12:37:11+05:30",
"end_date": "2.25-11-15T12:37:11+05:30",
"duration": "3:00:00",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 2,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": false,
"rank_publishing_date": null,
"allow_pdf": false,
"created": "2.25-11-07T07:07:41.597Z",
"slug": "forum-ias-rbi-demo",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T07:12:49.873Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125894/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125894/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T08:02:46.845Z",
"remaining_time": "2.20:03",
"time_taken": "0:49:57",
"state": "Running",
"rank": "NA",
"max_rank": 0,
"percentage": "0",
"unanswered_count": 0,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125872/",
"id": 125872,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/aiims-exam/",
"id": 3625,
"title": "AIIMS Exam",
"description": "",
"course": "TNPSC",
"start_date": "2.25-10-20T18:12:26+05:30",
"end_date": null,
"duration": "3:12:27",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 3,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": true,
"rank_publishing_date": "2.25-10-20T12:42:44Z",
"allow_pdf": false,
"created": "2.25-10-20T12:43:01.684Z",
"slug": "aiims-exam",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T06:17:42.313Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125872/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125872/questions/",
"percentile": 60,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T06:17:42.375Z",
"remaining_time": "3:12:26",
"time_taken": "0:00:01",
"state": "Completed",
"rank": 4,
"max_rank": 5,
"percentage": "0",
"unanswered_count": 200,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
}
]
}
C#

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125894/",
"id": 125894,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/forum-ias-rbi-demo/",
"id": 3720,
"title": "FORUM IAS RBI DEMO",
"description": "",
"course": "TNPSC",
"start_date": "2.25-11-07T12:37:11+05:30",
"end_date": "2.25-11-15T12:37:11+05:30",
"duration": "3:00:00",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 2,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": false,
"rank_publishing_date": null,
"allow_pdf": false,
"created": "2.25-11-07T07:07:41.597Z",
"slug": "forum-ias-rbi-demo",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T07:12:49.873Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125894/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125894/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T08:02:46.845Z",
"remaining_time": "2.20:03",
"time_taken": "0:49:57",
"state": "Running",
"rank": "NA",
"max_rank": 0,
"percentage": "0",
"unanswered_count": 0,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125872/",
"id": 125872,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/aiims-exam/",
"id": 3625,
"title": "AIIMS Exam",
"description": "",
"course": "TNPSC",
"start_date": "2.25-10-20T18:12:26+05:30",
"end_date": null,
"duration": "3:12:27",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 3,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": true,
"rank_publishing_date": "2.25-10-20T12:42:44Z",
"allow_pdf": false,
"created": "2.25-10-20T12:43:01.684Z",
"slug": "aiims-exam",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T06:17:42.313Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125872/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125872/questions/",
"percentile": 60,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T06:17:42.375Z",
"remaining_time": "3:12:26",
"time_taken": "0:00:01",
"state": "Completed",
"rank": 4,
"max_rank": 5,
"percentage": "0",
"unanswered_count": 200,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
}
]
}
PHP

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125894/",
"id": 125894,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/forum-ias-rbi-demo/",
"id": 3720,
"title": "FORUM IAS RBI DEMO",
"description": "",
"course": "TNPSC",
"start_date": "2.25-11-07T12:37:11+05:30",
"end_date": "2.25-11-15T12:37:11+05:30",
"duration": "3:00:00",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 2,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": false,
"rank_publishing_date": null,
"allow_pdf": false,
"created": "2.25-11-07T07:07:41.597Z",
"slug": "forum-ias-rbi-demo",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T07:12:49.873Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125894/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125894/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T08:02:46.845Z",
"remaining_time": "2.20:03",
"time_taken": "0:49:57",
"state": "Running",
"rank": "NA",
"max_rank": 0,
"percentage": "0",
"unanswered_count": 0,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125872/",
"id": 125872,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/aiims-exam/",
"id": 3625,
"title": "AIIMS Exam",
"description": "",
"course": "TNPSC",
"start_date": "2.25-10-20T18:12:26+05:30",
"end_date": null,
"duration": "3:12:27",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 3,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": true,
"rank_publishing_date": "2.25-10-20T12:42:44Z",
"allow_pdf": false,
"created": "2.25-10-20T12:43:01.684Z",
"slug": "aiims-exam",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T06:17:42.313Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125872/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125872/questions/",
"percentile": 60,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T06:17:42.375Z",
"remaining_time": "3:12:26",
"time_taken": "0:00:01",
"state": "Completed",
"rank": 4,
"max_rank": 5,
"percentage": "0",
"unanswered_count": 200,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
}
]
}
Java

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125894/",
"id": 125894,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/forum-ias-rbi-demo/",
"id": 3720,
"title": "FORUM IAS RBI DEMO",
"description": "",
"course": "TNPSC",
"start_date": "2.25-11-07T12:37:11+05:30",
"end_date": "2.25-11-15T12:37:11+05:30",
"duration": "3:00:00",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 2,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": false,
"rank_publishing_date": null,
"allow_pdf": false,
"created": "2.25-11-07T07:07:41.597Z",
"slug": "forum-ias-rbi-demo",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T07:12:49.873Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125894/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125894/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T08:02:46.845Z",
"remaining_time": "2.20:03",
"time_taken": "0:49:57",
"state": "Running",
"rank": "NA",
"max_rank": 0,
"percentage": "0",
"unanswered_count": 0,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125872/",
"id": 125872,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/aiims-exam/",
"id": 3625,
"title": "AIIMS Exam",
"description": "",
"course": "TNPSC",
"start_date": "2.25-10-20T18:12:26+05:30",
"end_date": null,
"duration": "3:12:27",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 3,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": true,
"rank_publishing_date": "2.25-10-20T12:42:44Z",
"allow_pdf": false,
"created": "2.25-10-20T12:43:01.684Z",
"slug": "aiims-exam",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T06:17:42.313Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125872/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125872/questions/",
"percentile": 60,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T06:17:42.375Z",
"remaining_time": "3:12:26",
"time_taken": "0:00:01",
"state": "Completed",
"rank": 4,
"max_rank": 5,
"percentage": "0",
"unanswered_count": 200,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
}
]
}
NodeJS

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125894/",
"id": 125894,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/forum-ias-rbi-demo/",
"id": 3720,
"title": "FORUM IAS RBI DEMO",
"description": "",
"course": "TNPSC",
"start_date": "2.25-11-07T12:37:11+05:30",
"end_date": "2.25-11-15T12:37:11+05:30",
"duration": "3:00:00",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 2,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": false,
"rank_publishing_date": null,
"allow_pdf": false,
"created": "2.25-11-07T07:07:41.597Z",
"slug": "forum-ias-rbi-demo",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T07:12:49.873Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125894/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125894/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T08:02:46.845Z",
"remaining_time": "2.20:03",
"time_taken": "0:49:57",
"state": "Running",
"rank": "NA",
"max_rank": 0,
"percentage": "0",
"unanswered_count": 0,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125872/",
"id": 125872,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/aiims-exam/",
"id": 3625,
"title": "AIIMS Exam",
"description": "",
"course": "TNPSC",
"start_date": "2.25-10-20T18:12:26+05:30",
"end_date": null,
"duration": "3:12:27",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 3,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": true,
"rank_publishing_date": "2.25-10-20T12:42:44Z",
"allow_pdf": false,
"created": "2.25-10-20T12:43:01.684Z",
"slug": "aiims-exam",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T06:17:42.313Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125872/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125872/questions/",
"percentile": 60,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T06:17:42.375Z",
"remaining_time": "3:12:26",
"time_taken": "0:00:01",
"state": "Completed",
"rank": 4,
"max_rank": 5,
"percentage": "0",
"unanswered_count": 200,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
}
]
}
Go

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125894/",
"id": 125894,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/forum-ias-rbi-demo/",
"id": 3720,
"title": "FORUM IAS RBI DEMO",
"description": "",
"course": "TNPSC",
"start_date": "2.25-11-07T12:37:11+05:30",
"end_date": "2.25-11-15T12:37:11+05:30",
"duration": "3:00:00",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 2,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": false,
"rank_publishing_date": null,
"allow_pdf": false,
"created": "2.25-11-07T07:07:41.597Z",
"slug": "forum-ias-rbi-demo",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T07:12:49.873Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125894/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125894/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T08:02:46.845Z",
"remaining_time": "2.20:03",
"time_taken": "0:49:57",
"state": "Running",
"rank": "NA",
"max_rank": 0,
"percentage": "0",
"unanswered_count": 0,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/125872/",
"id": 125872,
"exam": {
"url": "http://demo.testpress.in/api/v2.2/exams/aiims-exam/",
"id": 3625,
"title": "AIIMS Exam",
"description": "",
"course": "TNPSC",
"start_date": "2.25-10-20T18:12:26+05:30",
"end_date": null,
"duration": "3:12:27",
"number_of_questions": 200,
"negative_marks": "0.00",
"mark_per_question": "1.00",
"template_type": 3,
"allow_retake": true,
"max_retakes": null,
"enable_ranks": true,
"rank_publishing_date": "2.25-10-20T12:42:44Z",
"allow_pdf": false,
"created": "2.25-10-20T12:43:01.684Z",
"slug": "aiims-exam",
"variable_mark_per_question": false,
"show_answers": true
},
"user": "testpress",
"date": "2.25-11-07T06:17:42.313Z",
"total_questions": 200,
"score": "0.00",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/125872/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/125872/questions/",
"percentile": 60,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2.25-11-07T06:17:42.375Z",
"remaining_time": "3:12:26",
"time_taken": "0:00:01",
"state": "Completed",
"rank": 4,
"max_rank": 5,
"percentage": "0",
"unanswered_count": 200,
"commented_questions_count": 0,
"comments_count": 0,
"allow_retake": true,
"remaining_attempts": null,
"total_bonus": 0
}
]
}

Get All Attempts Of An Exam

This endpoint retrieves the attempts of a user for a particular exam.

HTTP Request

GET /api/v2.2/exams/<slug>/attempts/

URL Parameters

Parameter

Description

slug

The unique slug of the exam for which the attempts should be retrieved

cURL
Ruby
Python
C#
PHP
Java
NodeJS
Go
cURL
curl --request GET \
--url http://demo.testpress.in/api/v2.2/exams/mathjax-sample-exam/attempts/ \
--header 'authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw' \
--header 'cache-control: no-cache'

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/369/",
"id": 369,
"user": {
"id": 5,
"url": "http://demo.testpress.in/api/v2.2/users/5/",
"username": "demouser",
"display_name": "DemoUser is my name eeeeee123456789012345678901234",
"first_name": "DemoUser is my name eeeeee123456789012345678901234",
"last_name": "",
"photo": "https://media.testpress.in/i/bc194c3b0f3241ad9473edf949de3cec.jpeg",
"large_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/459b2af2355549dc8d7f411553128903.jpeg",
"medium_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/05c3efc7e4e3454ebad1c32c0c69297c.jpeg",
"medium_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/ca7ae15e26cc4586ae5f98750c2acc62.jpeg",
"small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/33936fd431e14a9ab54d7e24e70bf301.jpeg",
"x_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/673ceb6e18b343318fba39279ef07594.jpeg",
"mini_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/3214f5359ad247d1b2e38609376af72b.jpeg"
},
"date": "2017-04-25T14:34:26.848Z",
"total_questions": 25,
"score": "0.00",
"review_pdf_url": "",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/369/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/369/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2017-05-11T12:26:08.889Z",
"remaining_time": "1:09:31",
"time_taken": "1:50:29",
"state": "Running",
"rank": 2,
"max_rank": 165,
"percentage": "0",
"unanswered_count": 0,
"rank_enabled": true,
"sections": [],
"speed": 0,
"accuracy": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/12/",
"id": 12,
"user": {
"id": 5,
"url": "http://demo.testpress.in/api/v2.2/users/5/",
"username": "demouser",
"display_name": "DemoUser is my name eeeeee123456789012345678901234",
"first_name": "DemoUser is my name eeeeee123456789012345678901234",
"last_name": "",
"photo": "https://media.testpress.in/i/bc194c3b0f3241ad9473edf949de3cec.jpeg",
"large_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/459b2af2355549dc8d7f411553128903.jpeg",
"medium_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/05c3efc7e4e3454ebad1c32c0c69297c.jpeg",
"medium_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/ca7ae15e26cc4586ae5f98750c2acc62.jpeg",
"small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/33936fd431e14a9ab54d7e24e70bf301.jpeg",
"x_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/673ceb6e18b343318fba39279ef07594.jpeg",
"mini_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/3214f5359ad247d1b2e38609376af72b.jpeg"
},
"date": "2017-01-24T06:33:09.230Z",
"total_questions": 16,
"score": "3.00",
"review_pdf_url": "",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/12/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/12/questions/",
"percentile": 83.64,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2017-01-24T06:33:51.754Z",
"remaining_time": "2:59:17",
"time_taken": "0:00:43",
"state": "Completed",
"rank": 2,
"max_rank": 165,
"percentage": "12",
"unanswered_count": 0,
"rank_enabled": true,
"sections": [],
"speed": 847,
"accuracy": 30
}
]
}
Ruby
require 'uri'
require 'net/http'
url = URI("http://demo.testpress.in/api/v2.2/exams/mathjax-sample-exam/attempts/")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["authorization"] = 'JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw'
request["cache-control"] = 'no-cache'
response = http.request(request)
puts response.read_body

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/369/",
"id": 369,
"user": {
"id": 5,
"url": "http://demo.testpress.in/api/v2.2/users/5/",
"username": "demouser",
"display_name": "DemoUser is my name eeeeee123456789012345678901234",
"first_name": "DemoUser is my name eeeeee123456789012345678901234",
"last_name": "",
"photo": "https://media.testpress.in/i/bc194c3b0f3241ad9473edf949de3cec.jpeg",
"large_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/459b2af2355549dc8d7f411553128903.jpeg",
"medium_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/05c3efc7e4e3454ebad1c32c0c69297c.jpeg",
"medium_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/ca7ae15e26cc4586ae5f98750c2acc62.jpeg",
"small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/33936fd431e14a9ab54d7e24e70bf301.jpeg",
"x_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/673ceb6e18b343318fba39279ef07594.jpeg",
"mini_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/3214f5359ad247d1b2e38609376af72b.jpeg"
},
"date": "2017-04-25T14:34:26.848Z",
"total_questions": 25,
"score": "0.00",
"review_pdf_url": "",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/369/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/369/questions/",
"percentile": 0,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2017-05-11T12:26:08.889Z",
"remaining_time": "1:09:31",
"time_taken": "1:50:29",
"state": "Running",
"rank": 2,
"max_rank": 165,
"percentage": "0",
"unanswered_count": 0,
"rank_enabled": true,
"sections": [],
"speed": 0,
"accuracy": 0
},
{
"url": "http://demo.testpress.in/api/v2.2/attempts/12/",
"id": 12,
"user": {
"id": 5,
"url": "http://demo.testpress.in/api/v2.2/users/5/",
"username": "demouser",
"display_name": "DemoUser is my name eeeeee123456789012345678901234",
"first_name": "DemoUser is my name eeeeee123456789012345678901234",
"last_name": "",
"photo": "https://media.testpress.in/i/bc194c3b0f3241ad9473edf949de3cec.jpeg",
"large_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/459b2af2355549dc8d7f411553128903.jpeg",
"medium_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/05c3efc7e4e3454ebad1c32c0c69297c.jpeg",
"medium_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/ca7ae15e26cc4586ae5f98750c2acc62.jpeg",
"small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/33936fd431e14a9ab54d7e24e70bf301.jpeg",
"x_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/673ceb6e18b343318fba39279ef07594.jpeg",
"mini_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/3214f5359ad247d1b2e38609376af72b.jpeg"
},
"date": "2017-01-24T06:33:09.230Z",
"total_questions": 16,
"score": "3.00",
"review_pdf_url": "",
"review_url": "http://demo.testpress.in/api/v2.2/attempts/12/review/",
"questions_url": "http://demo.testpress.in/api/v2.2/attempts/12/questions/",
"percentile": 83.64,
"correct_count": 0,
"incorrect_count": 0,
"last_started_time": "2017-01-24T06:33:51.754Z",
"remaining_time": "2:59:17",
"time_taken": "0:00:43",
"state": "Completed",
"rank": 2,
"max_rank": 165,
"percentage": "12",
"unanswered_count": 0,
"rank_enabled": true,
"sections": [],
"speed": 847,
"accuracy": 30
}
]
}
Python
import requests
url = "http://demo.testpress.in/api/v2.2/exams/mathjax-sample-exam/attempts/"
headers = {
'authorization': "JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6InRlc3RwcmVzcyIsInVzZXJfaWQiOjE3LCJlbWFpbCI6InRlc3RwcmVzcy5pbkBnbWFpbC5jb20iLCJleHAiOjE0NDc4MzMyMjl9.Ik_yi4lHbNbrRGhqmRpsW82Nls_O9lgXakk_syV-vSw",
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers)
print(response.text)

The above command returns JSON structured like this:

{
"count": 2,
"next": null,
"previous": null,
"per_page": 20,
"results": [
{
"url": "http://demo.testpress.in/api/v2.2/attempts/369/",
"id": 369,
"user": {
"id": 5,
"url": "http://demo.testpress.in/api/v2.2/users/5/",
"username": "demouser",
"display_name": "DemoUser is my name eeeeee123456789012345678901234",
"first_name": "DemoUser is my name eeeeee123456789012345678901234",
"last_name": "",
"photo": "https://media.testpress.in/i/bc194c3b0f3241ad9473edf949de3cec.jpeg",
"large_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/459b2af2355549dc8d7f411553128903.jpeg",
"medium_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/05c3efc7e4e3454ebad1c32c0c69297c.jpeg",
"medium_small_image": "https://s3-ap-southeast-1.amazonaws.com/media.testpress.in/i/ca7ae15e26cc4586ae5f98750c2acc62.jpeg",