# Get Batch Responses GET https://api.prolific.com/api/v1/data-collection/batches/{batch_id}/responses Get responses for an AI Task Builder batch as JSON. Returns individual response records for programmatic processing. Reference: https://beta-docs.prolific.com/api-reference/ai-task-builder/get-task-builder-batch-task-responses ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get Batch Responses version: endpoint_aiTaskBuilder.GetTaskBuilderBatchTaskResponses paths: /api/v1/data-collection/batches/{batch_id}/responses: get: operationId: get-task-builder-batch-task-responses summary: Get Batch Responses description: >- Get responses for an AI Task Builder batch as JSON. Returns individual response records for programmatic processing. tags: - - subpackage_aiTaskBuilder parameters: - name: batch_id in: path 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/AI Task Builder_GetTaskBuilderBatchTaskResponses_Response_200 '400': description: Error content: {} components: schemas: AiTaskBuilderTaskResponseResponseType: type: string enum: - value: multiple_choice - value: free_text - value: multiple_choice_with_free_text - value: file_upload AiTaskBuilderTaskResponseResponseAnswerItemsValue: oneOf: - type: string - type: number format: double - type: boolean AiTaskBuilderTaskResponseResponseAnswerItems: type: object properties: value: $ref: >- #/components/schemas/AiTaskBuilderTaskResponseResponseAnswerItemsValue AiTaskBuilderTaskResponseResponse: type: object properties: instruction_id: type: string type: $ref: '#/components/schemas/AiTaskBuilderTaskResponseResponseType' answer: type: array items: $ref: '#/components/schemas/AiTaskBuilderTaskResponseResponseAnswerItems' required: - instruction_id - type - answer AITaskBuilderTaskResponse: type: object properties: id: type: string format: uuid created_at: type: string format: date-time batch_id: type: string participant_id: type: string submission_id: type: string description: The Prolific submission ID correlation_id: type: string description: Correlation ID for tracking response: $ref: '#/components/schemas/AiTaskBuilderTaskResponseResponse' task_id: type: string metadata: type: object additionalProperties: description: Any type schema_version: type: integer no_submission: type: boolean required: - id - created_at - batch_id - participant_id - response - task_id ApiV1DataCollectionBatchesBatchIdResponsesGetResponsesContentApplicationJsonSchemaMeta: type: object properties: count: type: integer description: Total number of responses AI Task Builder_GetTaskBuilderBatchTaskResponses_Response_200: type: object properties: results: type: array items: $ref: '#/components/schemas/AITaskBuilderTaskResponse' meta: $ref: >- #/components/schemas/ApiV1DataCollectionBatchesBatchIdResponsesGetResponsesContentApplicationJsonSchemaMeta ``` ## SDK Code Examples ```python import requests url = "https://api.prolific.com/api/v1/data-collection/batches/batch_id/responses" 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/responses'; 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/responses" 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/responses") 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/responses") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://api.prolific.com/api/v1/data-collection/batches/batch_id/responses', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/data-collection/batches/batch_id/responses"); 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/responses")! 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() ```