# Get a participant group GET https://api.prolific.com/api/v1/participant-groups/{id}/ Reference: https://beta-docs.prolific.com/api-reference/participant-groups/get-participant-group ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: Get a participant group version: endpoint_participantGroups.GetParticipantGroup paths: /api/v1/participant-groups/{id}/: get: operationId: get-participant-group summary: Get a participant group tags: - - subpackage_participantGroups parameters: - name: id in: path description: The id of the participant group required: true schema: type: string - name: Authorization in: header description: Header authentication of the form `undefined ` required: true schema: type: string responses: '200': description: Request successful. content: application/json: schema: $ref: '#/components/schemas/ParticipantGroupResponse' '400': description: Error content: {} components: schemas: ParticipantGroupFeederStudiesItemsFeederCompletionCodesItemsAction: type: string enum: - value: ADD_TO_PARTICIPANT_GROUP - value: REMOVE_FROM_PARTICIPANT_GROUP ParticipantGroupFeederStudiesItemsFeederCompletionCodesItems: type: object properties: code: type: string description: The code that will modify the participants in this group. code_type: type: string description: >- The label or code type given to this code within the context of the study. action: $ref: >- #/components/schemas/ParticipantGroupFeederStudiesItemsFeederCompletionCodesItemsAction description: The action that will be taken when this code is used. ParticipantGroupFeederStudiesItems: type: object properties: id: type: string description: The id of the study. name: type: string description: The name of the study. internal_name: type: string description: The internal name of the study. status: type: string description: The current status of the study. feeder_completion_codes: type: array items: $ref: >- #/components/schemas/ParticipantGroupFeederStudiesItemsFeederCompletionCodesItems description: >- The completion codes which will modify the participants in this group. ParticipantGroupResponse: type: object properties: id: type: string description: The id of the participant group name: type: string description: The name of the participant group project_id: type: - string - 'null' description: The id of the project the participant group belongs to workspace_id: type: - string - 'null' description: >- The id of the workspace the participant group belongs to. A participant group can only belong to either a workspace or an organisation. organisation_id: type: - string - 'null' description: >- The id of the organisation the participant group belongs to. A participant group can only belong to either a workspace or an organisation. description: type: - string - 'null' description: The user-provided description of the participant group participant_count: type: integer description: The number of participants in the participant group is_deleted: type: boolean description: Whether the participant group has been deleted feeder_studies: type: array items: $ref: '#/components/schemas/ParticipantGroupFeederStudiesItems' description: >- Details of all studies which are configured to modify the participants in this group through completion codes. ``` ## SDK Code Examples ```python import requests url = "https://api.prolific.com/api/v1/participant-groups/id/" headers = {"Authorization": ""} response = requests.get(url, headers=headers) print(response.json()) ``` ```javascript const url = 'https://api.prolific.com/api/v1/participant-groups/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/participant-groups/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/participant-groups/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/participant-groups/id/") .header("Authorization", "") .asString(); ``` ```php request('GET', 'https://api.prolific.com/api/v1/participant-groups/id/', [ 'headers' => [ 'Authorization' => '', ], ]); echo $response->getBody(); ``` ```csharp var client = new RestClient("https://api.prolific.com/api/v1/participant-groups/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/participant-groups/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() ```