# Get a Batch GET https://api.prolific.com/api/v1/data-collection/batches/{batch_id} Get a specific AI Task Builder batch by its unique identifier. Reference: https://beta-docs.prolific.com/api-reference/ai-task-builder/get-task-builder-batch ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get a Batch version: endpoint_aiTaskBuilder.GetTaskBuilderBatch paths: /api/v1/data-collection/batches/{batch_id}: get: operationId: get-task-builder-batch summary: Get a Batch description: Get a specific AI Task Builder batch by its unique identifier. tags: - - subpackage_aiTaskBuilder parameters: - name: batch_id in: path description: The unique identifier of the AI Task Builder batch required: true schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: Ok content: application/json: schema: $ref: '#/components/schemas/AITaskBuilderBatch' '400': description: Error content: {} components: schemas: AiTaskBuilderBatchDatasetsItems: type: object properties: id: type: string format: uuid total_datapoint_count: type: integer filename: type: string description: The filename of the dataset required: - id - total_datapoint_count - filename AiTaskBuilderBatchStatus: type: string enum: - value: UNINITIALISED - value: PROCESSING - value: READY - value: ERROR AiTaskBuilderBatchTaskDetails: type: object properties: task_name: type: string task_introduction: type: string description: HTML formatted task introduction task_steps: type: string description: HTML formatted task steps required: - task_name - task_introduction - task_steps AITaskBuilderBatch: type: object properties: id: type: string format: uuid created_at: type: string format: date-time description: >- An ISO-8601 formatted string representing the batch creation time, in UTC. created_by: type: string description: User ID of the Prolific user that created the resource. datasets: type: array items: $ref: '#/components/schemas/AiTaskBuilderBatchDatasetsItems' name: type: string status: $ref: '#/components/schemas/AiTaskBuilderBatchStatus' total_task_count: type: integer total_instruction_count: type: integer workspace_id: type: string schema_version: type: integer task_details: $ref: '#/components/schemas/AiTaskBuilderBatchTaskDetails' total_task_groups: type: integer required: - id - created_at - created_by - datasets - name - status - total_task_count - total_instruction_count - workspace_id - schema_version - task_details - total_task_groups ``` ## SDK Code Examples ```python import requests url = "https://api.prolific.com/api/v1/data-collection/batches/batch_id" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.prolific.com/api/v1/data-collection/batches/batch_id'; const options = {method: 'GET', headers: {Authorization: ''}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "https://api.prolific.com/api/v1/data-collection/batches/batch_id" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("https://api.prolific.com/api/v1/data-collection/batches/batch_id") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = '' response = http.request(request) puts response.read_body ``` ```java HttpResponse response = Unirest.get("https://api.prolific.com/api/v1/data-collection/batches/batch_id") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://api.prolific.com/api/v1/data-collection/batches/batch_id', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/data-collection/batches/batch_id"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", ""); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": ""] let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/data-collection/batches/batch_id")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```