Skip to main content

Batches

info

Admin APIs require authorization token with admin privileges. You check the following link to generate an authorization token. You need to provide an admin username and password to generate token with admin privileges.

Authentication

Batches API lets you create and retrieve batches in your institute.

Get All Batches​

This endpoint retrieves all the batches available in your institute

HTTP Request​

GET /api/v2.5/admin/batches/

Query Parameters​

ParameterTypeDescription
searchstringFilters by batch name.

Fields​

NameTypeDescription
idintThe batch unique ID
namestringBatch's Name
urlstringURL to get details of the batch
curl --request GET \
--url http://demo.testpress.in/api/v2.5/admin/batches/ \
--header 'authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6MTgsInVzZXJfaWQiOjE4LCJlbWFpbCI6ImRpbmVzaEB0ZXN0cHJlc3MuaW4iLCJleHAiOjE0NzAzMTEyNzl9.fDF03EIOEoXTyVUA3sN9-biUGhWrzO_NIZo1KYCUkbU' \
--header 'cache-control: no-cache'

Response​

{
"count": 21,
"next": "http://demo.testpress.in/api/v2.5/admin/batches/?page=2",
"previous": null,
"per_page": 20,
"results": [
{
"id": 33,
"name": "TNPSC DEMO EXAM BATCH",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/33/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 32,
"name": "Orient Ias Test Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/32/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 31,
"name": "Super Profs Test batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/31/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 30,
"name": "Sample new",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/30/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 29,
"name": "Test Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/29/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 28,
"name": "9th Students Tambaram 2016",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/28/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 27,
"name": "8th Standard Tambaram 2016",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/27/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 26,
"name": "UPSC Evening Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/26/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 25,
"name": "IBPS Online Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/25/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 24,
"name": "NEET Morning Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/24/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 23,
"name": "UPSC Morning Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/23/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 22,
"name": "IBPS Morning Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/22/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 21,
"name": "st std A",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/21/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 20,
"name": "OHC 2013",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/20/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 19,
"name": "POZITIVE ONLINE TEST SERIES",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/19/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 18,
"name": "Unique UPSC Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/18/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 17,
"name": "ECE",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/17/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 16,
"name": "EEE",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/16/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 15,
"name": "DISHA BATCH 1",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/15/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
},
{
"id": 2,
"name": "Career Anna Test Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/2/"
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
}
]
}

Get A Single Batch​

This endpoint retrieves details of a single batch

HTTP Request​

GET /api/v2.5/admin/batches/<id>

URL Parameters​

ParameterDescription
idUnique Id of the batch to retriever
curl --request GET \
--url http://demo.testpress.in/api/v2.5/admin/batches/26/ \
--header 'authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6MTgsInVzZXJfaWQiOjE4LCJlbWFpbCI6ImRpbmVzaEB0ZXN0cHJlc3MuaW4iLCJleHAiOjE0NzAzMTEyNzl9.fDF03EIOEoXTyVUA3sN9-biUGhWrzO_NIZo1KYCUkbU' \
--header 'cache-control: no-cache'

Response​

 {
"id": 26,
"name": "UPSC Evening Batch",
"url": "http://demo.testpress.in/api/v2.5/admin/batches/26/",
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z"
}

Create A Batch​

This endpoint creates a new batch in your institute

HTTP Request​

POST /api/v2.5/admin/batches/
NameTypeDescription
idintThe batch unique ID
namestringBatch's Name
urlstringURL to get details of the batch
curl --request POST \
--url http://demo.testpress.in/api/v2.5/admin/batches/ \
--header 'authorization: JWT eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VybmFtZSI6MTgsInVzZXJfaWQiOjE4LCJlbWFpbCI6ImRpbmVzaEB0ZXN0cHJlc3MuaW4iLCJleHAiOjE0NzAzMTEyNzl9.fDF03EIOEoXTyVUA3sN9-biUGhWrzO_NIZo1KYCUkbU' \
--header 'cache-control: no-cache' \
--data '{\n "name": "Online Test Batch"\n}'

Response​

 {
"id": 28,
"name": "Online Test Batch",
"url": "http://demo.testbench.in:8000/api/v2.5/admin/batches/28/",
"created": "2021-12-01T12:17:22.293198Z",
"modified": "2021-12-01T12:17:22.296839Z",
}