> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.prolific.com/llms.txt.
> For full documentation content, see https://docs.prolific.com/llms-full.txt.

# Your first data collection

This guide assumes you have already created a prolific account and generated an API token. If you haven't done this yet, please follow the steps in
[Getting started with Prolific's API](./overview).

You will also need to [top up your wallet](https://intercom-help.eu/prolific-research/en/articles/445242-adding-money-via-card-payment) in order to complete this guide. The default settings will cost \$1.50/£1.50.

With that done, you're ready to start your first data collection!

<Steps>
  <Step>
    ### Get your researcher ID

    To create Prolific surveys you need to know your researcher ID. You can get this by making a call to the user
    endpoint.

    ### Request

    GET [https://api.prolific.com/api/v1/users/me/](https://api.prolific.com/api/v1/users/me/)

    ```curl Users_GetUser_example
    curl https://api.prolific.com/api/v1/users/me/ \
         -H "Authorization: Token <token>"
    ```

    ```python Users_GetUser_example
    import requests

    url = "https://api.prolific.com/api/v1/users/me/"

    headers = {"Authorization": "Token <token>"}

    response = requests.get(url, headers=headers)

    print(response.json())
    ```

    ```javascript Users_GetUser_example
    const url = 'https://api.prolific.com/api/v1/users/me/';
    const options = {method: 'GET', headers: {Authorization: 'Token <token>'}};

    try {
      const response = await fetch(url, options);
      const data = await response.json();
      console.log(data);
    } catch (error) {
      console.error(error);
    }
    ```

    ```go Users_GetUser_example
    package main

    import (
    	"fmt"
    	"net/http"
    	"io"
    )

    func main() {

    	url := "https://api.prolific.com/api/v1/users/me/"

    	req, _ := http.NewRequest("GET", url, nil)

    	req.Header.Add("Authorization", "Token <token>")

    	res, _ := http.DefaultClient.Do(req)

    	defer res.Body.Close()
    	body, _ := io.ReadAll(res.Body)

    	fmt.Println(res)
    	fmt.Println(string(body))

    }
    ```

    ```ruby Users_GetUser_example
    require 'uri'
    require 'net/http'

    url = URI("https://api.prolific.com/api/v1/users/me/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Token <token>'

    response = http.request(request)
    puts response.read_body
    ```

    ```java Users_GetUser_example
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.get("https://api.prolific.com/api/v1/users/me/")
      .header("Authorization", "Token <token>")
      .asString();
    ```

    ```php Users_GetUser_example
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('GET', 'https://api.prolific.com/api/v1/users/me/', [
      'headers' => [
        'Authorization' => 'Token <token>',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp Users_GetUser_example
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/users/me/");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Token <token>");
    IRestResponse response = client.Execute(request);
    ```

    ```swift Users_GetUser_example
    import Foundation

    let headers = ["Authorization": "Token <token>"]

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/users/me/")! 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()
    ```

    Make a note of the user `id` from the response as you will need this in the next step.
  </Step>

  <Step>
    ### Create the survey

    Next let's create a survey. This survey will host the multiple choice questions you want to ask your
    participants.

    You will need to provide your researcher `id` from step 1 in the `researcher_id` field.

    ### Request

    POST [https://api.prolific.com/api/v1/surveys/](https://api.prolific.com/api/v1/surveys/)

    ```curl without_sections
    curl -X POST https://api.prolific.com/api/v1/surveys/ \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json" \
         -d '{
      "researcher_id": "7172727272",
      "title": "A survey with questions",
      "questions": [
        {
          "answers": [
            {
              "value": "Potato",
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            }
          ],
          "title": "What is your favourite root vegetable?",
          "type": "single",
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        }
      ]
    }'
    ```

    ```python without_sections
    import requests

    url = "https://api.prolific.com/api/v1/surveys/"

    payload = {
        "researcher_id": "7172727272",
        "title": "A survey with questions",
        "questions": [
            {
                "answers": [
                    {
                        "value": "Potato",
                        "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
                    }
                ],
                "title": "What is your favourite root vegetable?",
                "type": "single",
                "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            }
        ]
    }
    headers = {
        "Authorization": "Token <token>",
        "Content-Type": "application/json"
    }

    response = requests.post(url, json=payload, headers=headers)

    print(response.json())
    ```

    ```javascript without_sections
    const url = 'https://api.prolific.com/api/v1/surveys/';
    const options = {
      method: 'POST',
      headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
      body: '{"researcher_id":"7172727272","title":"A survey with questions","questions":[{"answers":[{"value":"Potato","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}],"title":"What is your favourite root vegetable?","type":"single","id":"497f6eca-6276-4993-bfeb-53cbbbba6f08"}]}'
    };

    try {
      const response = await fetch(url, options);
      const data = await response.json();
      console.log(data);
    } catch (error) {
      console.error(error);
    }
    ```

    ```go without_sections
    package main

    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io"
    )

    func main() {

    	url := "https://api.prolific.com/api/v1/surveys/"

    	payload := strings.NewReader("{\n  \"researcher_id\": \"7172727272\",\n  \"title\": \"A survey with questions\",\n  \"questions\": [\n    {\n      \"answers\": [\n        {\n          \"value\": \"Potato\",\n          \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n        }\n      ],\n      \"title\": \"What is your favourite root vegetable?\",\n      \"type\": \"single\",\n      \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n    }\n  ]\n}")

    	req, _ := http.NewRequest("POST", url, payload)

    	req.Header.Add("Authorization", "Token <token>")
    	req.Header.Add("Content-Type", "application/json")

    	res, _ := http.DefaultClient.Do(req)

    	defer res.Body.Close()
    	body, _ := io.ReadAll(res.Body)

    	fmt.Println(res)
    	fmt.Println(string(body))

    }
    ```

    ```ruby without_sections
    require 'uri'
    require 'net/http'

    url = URI("https://api.prolific.com/api/v1/surveys/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Post.new(url)
    request["Authorization"] = 'Token <token>'
    request["Content-Type"] = 'application/json'
    request.body = "{\n  \"researcher_id\": \"7172727272\",\n  \"title\": \"A survey with questions\",\n  \"questions\": [\n    {\n      \"answers\": [\n        {\n          \"value\": \"Potato\",\n          \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n        }\n      ],\n      \"title\": \"What is your favourite root vegetable?\",\n      \"type\": \"single\",\n      \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n    }\n  ]\n}"

    response = http.request(request)
    puts response.read_body
    ```

    ```java without_sections
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/surveys/")
      .header("Authorization", "Token <token>")
      .header("Content-Type", "application/json")
      .body("{\n  \"researcher_id\": \"7172727272\",\n  \"title\": \"A survey with questions\",\n  \"questions\": [\n    {\n      \"answers\": [\n        {\n          \"value\": \"Potato\",\n          \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n        }\n      ],\n      \"title\": \"What is your favourite root vegetable?\",\n      \"type\": \"single\",\n      \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n    }\n  ]\n}")
      .asString();
    ```

    ```php without_sections
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('POST', 'https://api.prolific.com/api/v1/surveys/', [
      'body' => '{
      "researcher_id": "7172727272",
      "title": "A survey with questions",
      "questions": [
        {
          "answers": [
            {
              "value": "Potato",
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            }
          ],
          "title": "What is your favourite root vegetable?",
          "type": "single",
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        }
      ]
    }',
      'headers' => [
        'Authorization' => 'Token <token>',
        'Content-Type' => 'application/json',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp without_sections
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/surveys/");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "Token <token>");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\n  \"researcher_id\": \"7172727272\",\n  \"title\": \"A survey with questions\",\n  \"questions\": [\n    {\n      \"answers\": [\n        {\n          \"value\": \"Potato\",\n          \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n        }\n      ],\n      \"title\": \"What is your favourite root vegetable?\",\n      \"type\": \"single\",\n      \"id\": \"497f6eca-6276-4993-bfeb-53cbbbba6f08\"\n    }\n  ]\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```

    ```swift without_sections
    import Foundation

    let headers = [
      "Authorization": "Token <token>",
      "Content-Type": "application/json"
    ]
    let parameters = [
      "researcher_id": "7172727272",
      "title": "A survey with questions",
      "questions": [
        [
          "answers": [
            [
              "value": "Potato",
              "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
            ]
          ],
          "title": "What is your favourite root vegetable?",
          "type": "single",
          "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08"
        ]
      ]
    ] as [String : Any]

    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/surveys/")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data

    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()
    ```

    You can find more details on Prolific Surveys in the [Surveys
    documentation](https://researcher-help.prolific.com/en/articles/445141-survey-builder).

    Make a note of the `_id` from the response as this is the identifier of the survey; you'll need this in the
    following steps.
  </Step>

  <Step>
    ### Create the study

    Next, create a study to select the participants you'd like to take the study.

    The `external_study_url` on the study will be `https://prolific.com/surveys/{survey_id}`, using survey `_id` from
    step 1.

    ### Request

    POST [https://api.prolific.com/api/v1/studies/](https://api.prolific.com/api/v1/studies/)

    ```curl your_first_data_collection_study
    curl -X POST https://api.prolific.com/api/v1/studies/ \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json" \
         -d '{
      "name": "Your First Data Collection Study",
      "description": "A study using prolific surveys to collect data",
      "external_study_url": "https://prolific.com/surveys/{survey_id}",
      "prolific_id_option": "question",
      "total_available_places": 10,
      "estimated_completion_time": 1,
      "reward": 15,
      "completion_codes": [
        {
          "code": "STUDY_COMPLETED",
          "code_type": "COMPLETED",
          "actions": [
            {
              "action": "MANUALLY_REVIEW"
            }
          ]
        }
      ],
      "device_compatibility": [
        "mobile",
        "desktop",
        "tablet"
      ],
      "peripheral_requirements": [],
      "filters": [
        {
          "filter_id": "age",
          "selected_range": {
            "lower": 18,
            "upper": 35
          }
        }
      ],
      "submissions_config": {
        "max_submissions_per_participant": 1
      },
      "completion_code": "STUDY_COMPLETED",
      "privacy_notice": "Your data will be used for research purposes only and will be kept confidential."
    }'
    ```

    ```python your_first_data_collection_study
    import requests

    url = "https://api.prolific.com/api/v1/studies/"

    payload = {
        "name": "Your First Data Collection Study",
        "description": "A study using prolific surveys to collect data",
        "external_study_url": "https://prolific.com/surveys/{survey_id}",
        "prolific_id_option": "question",
        "total_available_places": 10,
        "estimated_completion_time": 1,
        "reward": 15,
        "completion_codes": [
            {
                "code": "STUDY_COMPLETED",
                "code_type": "COMPLETED",
                "actions": [{ "action": "MANUALLY_REVIEW" }]
            }
        ],
        "device_compatibility": ["mobile", "desktop", "tablet"],
        "peripheral_requirements": [],
        "filters": [
            {
                "filter_id": "age",
                "selected_range": {
                    "lower": 18,
                    "upper": 35
                }
            }
        ],
        "submissions_config": { "max_submissions_per_participant": 1 },
        "completion_code": "STUDY_COMPLETED",
        "privacy_notice": "Your data will be used for research purposes only and will be kept confidential."
    }
    headers = {
        "Authorization": "Token <token>",
        "Content-Type": "application/json"
    }

    response = requests.post(url, json=payload, headers=headers)

    print(response.json())
    ```

    ```javascript your_first_data_collection_study
    const url = 'https://api.prolific.com/api/v1/studies/';
    const options = {
      method: 'POST',
      headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
      body: '{"name":"Your First Data Collection Study","description":"A study using prolific surveys to collect data","external_study_url":"https://prolific.com/surveys/{survey_id}","prolific_id_option":"question","total_available_places":10,"estimated_completion_time":1,"reward":15,"completion_codes":[{"code":"STUDY_COMPLETED","code_type":"COMPLETED","actions":[{"action":"MANUALLY_REVIEW"}]}],"device_compatibility":["mobile","desktop","tablet"],"peripheral_requirements":[],"filters":[{"filter_id":"age","selected_range":{"lower":18,"upper":35}}],"submissions_config":{"max_submissions_per_participant":1},"completion_code":"STUDY_COMPLETED","privacy_notice":"Your data will be used for research purposes only and will be kept confidential."}'
    };

    try {
      const response = await fetch(url, options);
      const data = await response.json();
      console.log(data);
    } catch (error) {
      console.error(error);
    }
    ```

    ```go your_first_data_collection_study
    package main

    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io"
    )

    func main() {

    	url := "https://api.prolific.com/api/v1/studies/"

    	payload := strings.NewReader("{\n  \"name\": \"Your First Data Collection Study\",\n  \"description\": \"A study using prolific surveys to collect data\",\n  \"external_study_url\": \"https://prolific.com/surveys/{survey_id}\",\n  \"prolific_id_option\": \"question\",\n  \"total_available_places\": 10,\n  \"estimated_completion_time\": 1,\n  \"reward\": 15,\n  \"completion_codes\": [\n    {\n      \"code\": \"STUDY_COMPLETED\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"MANUALLY_REVIEW\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"filters\": [\n    {\n      \"filter_id\": \"age\",\n      \"selected_range\": {\n        \"lower\": 18,\n        \"upper\": 35\n      }\n    }\n  ],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"STUDY_COMPLETED\",\n  \"privacy_notice\": \"Your data will be used for research purposes only and will be kept confidential.\"\n}")

    	req, _ := http.NewRequest("POST", url, payload)

    	req.Header.Add("Authorization", "Token <token>")
    	req.Header.Add("Content-Type", "application/json")

    	res, _ := http.DefaultClient.Do(req)

    	defer res.Body.Close()
    	body, _ := io.ReadAll(res.Body)

    	fmt.Println(res)
    	fmt.Println(string(body))

    }
    ```

    ```ruby your_first_data_collection_study
    require 'uri'
    require 'net/http'

    url = URI("https://api.prolific.com/api/v1/studies/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Post.new(url)
    request["Authorization"] = 'Token <token>'
    request["Content-Type"] = 'application/json'
    request.body = "{\n  \"name\": \"Your First Data Collection Study\",\n  \"description\": \"A study using prolific surveys to collect data\",\n  \"external_study_url\": \"https://prolific.com/surveys/{survey_id}\",\n  \"prolific_id_option\": \"question\",\n  \"total_available_places\": 10,\n  \"estimated_completion_time\": 1,\n  \"reward\": 15,\n  \"completion_codes\": [\n    {\n      \"code\": \"STUDY_COMPLETED\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"MANUALLY_REVIEW\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"filters\": [\n    {\n      \"filter_id\": \"age\",\n      \"selected_range\": {\n        \"lower\": 18,\n        \"upper\": 35\n      }\n    }\n  ],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"STUDY_COMPLETED\",\n  \"privacy_notice\": \"Your data will be used for research purposes only and will be kept confidential.\"\n}"

    response = http.request(request)
    puts response.read_body
    ```

    ```java your_first_data_collection_study
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/studies/")
      .header("Authorization", "Token <token>")
      .header("Content-Type", "application/json")
      .body("{\n  \"name\": \"Your First Data Collection Study\",\n  \"description\": \"A study using prolific surveys to collect data\",\n  \"external_study_url\": \"https://prolific.com/surveys/{survey_id}\",\n  \"prolific_id_option\": \"question\",\n  \"total_available_places\": 10,\n  \"estimated_completion_time\": 1,\n  \"reward\": 15,\n  \"completion_codes\": [\n    {\n      \"code\": \"STUDY_COMPLETED\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"MANUALLY_REVIEW\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"filters\": [\n    {\n      \"filter_id\": \"age\",\n      \"selected_range\": {\n        \"lower\": 18,\n        \"upper\": 35\n      }\n    }\n  ],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"STUDY_COMPLETED\",\n  \"privacy_notice\": \"Your data will be used for research purposes only and will be kept confidential.\"\n}")
      .asString();
    ```

    ```php your_first_data_collection_study
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('POST', 'https://api.prolific.com/api/v1/studies/', [
      'body' => '{
      "name": "Your First Data Collection Study",
      "description": "A study using prolific surveys to collect data",
      "external_study_url": "https://prolific.com/surveys/{survey_id}",
      "prolific_id_option": "question",
      "total_available_places": 10,
      "estimated_completion_time": 1,
      "reward": 15,
      "completion_codes": [
        {
          "code": "STUDY_COMPLETED",
          "code_type": "COMPLETED",
          "actions": [
            {
              "action": "MANUALLY_REVIEW"
            }
          ]
        }
      ],
      "device_compatibility": [
        "mobile",
        "desktop",
        "tablet"
      ],
      "peripheral_requirements": [],
      "filters": [
        {
          "filter_id": "age",
          "selected_range": {
            "lower": 18,
            "upper": 35
          }
        }
      ],
      "submissions_config": {
        "max_submissions_per_participant": 1
      },
      "completion_code": "STUDY_COMPLETED",
      "privacy_notice": "Your data will be used for research purposes only and will be kept confidential."
    }',
      'headers' => [
        'Authorization' => 'Token <token>',
        'Content-Type' => 'application/json',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp your_first_data_collection_study
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/studies/");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "Token <token>");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\n  \"name\": \"Your First Data Collection Study\",\n  \"description\": \"A study using prolific surveys to collect data\",\n  \"external_study_url\": \"https://prolific.com/surveys/{survey_id}\",\n  \"prolific_id_option\": \"question\",\n  \"total_available_places\": 10,\n  \"estimated_completion_time\": 1,\n  \"reward\": 15,\n  \"completion_codes\": [\n    {\n      \"code\": \"STUDY_COMPLETED\",\n      \"code_type\": \"COMPLETED\",\n      \"actions\": [\n        {\n          \"action\": \"MANUALLY_REVIEW\"\n        }\n      ]\n    }\n  ],\n  \"device_compatibility\": [\n    \"mobile\",\n    \"desktop\",\n    \"tablet\"\n  ],\n  \"peripheral_requirements\": [],\n  \"filters\": [\n    {\n      \"filter_id\": \"age\",\n      \"selected_range\": {\n        \"lower\": 18,\n        \"upper\": 35\n      }\n    }\n  ],\n  \"submissions_config\": {\n    \"max_submissions_per_participant\": 1\n  },\n  \"completion_code\": \"STUDY_COMPLETED\",\n  \"privacy_notice\": \"Your data will be used for research purposes only and will be kept confidential.\"\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```

    ```swift your_first_data_collection_study
    import Foundation

    let headers = [
      "Authorization": "Token <token>",
      "Content-Type": "application/json"
    ]
    let parameters = [
      "name": "Your First Data Collection Study",
      "description": "A study using prolific surveys to collect data",
      "external_study_url": "https://prolific.com/surveys/{survey_id}",
      "prolific_id_option": "question",
      "total_available_places": 10,
      "estimated_completion_time": 1,
      "reward": 15,
      "completion_codes": [
        [
          "code": "STUDY_COMPLETED",
          "code_type": "COMPLETED",
          "actions": [["action": "MANUALLY_REVIEW"]]
        ]
      ],
      "device_compatibility": ["mobile", "desktop", "tablet"],
      "peripheral_requirements": [],
      "filters": [
        [
          "filter_id": "age",
          "selected_range": [
            "lower": 18,
            "upper": 35
          ]
        ]
      ],
      "submissions_config": ["max_submissions_per_participant": 1],
      "completion_code": "STUDY_COMPLETED",
      "privacy_notice": "Your data will be used for research purposes only and will be kept confidential."
    ] as [String : Any]

    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data

    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()
    ```

    There are many filters you can use to find your participants. In the example above we are selecting participants
    who are between 18 and 35 years old using the `filter_id` `age`.

    When a participant completes your study, you will need to review and approve their submission to ensure they get
    paid.
    You are able to automate this process using completion paths - see the [study object
    documentation](/api-reference/studies/the-study-object) for more details.

    Make a note of the `id` from the response as this is the identifier of the study; you'll need this in the following
    steps.
  </Step>

  <Step>
    ### Publish the study

    Next, publish the study to start recruiting participants.

    ### Request

    POST [https://api.prolific.com/api/v1/studies/\{id}/transition/](https://api.prolific.com/api/v1/studies/\{id}/transition/)

    ```curl Publish a draft study
    curl -X POST https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/ \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json" \
         -d '{
      "action": "PUBLISH"
    }'
    ```

    ```python Publish a draft study
    import requests

    url = "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/"

    payload = { "action": "PUBLISH" }
    headers = {
        "Authorization": "Token <token>",
        "Content-Type": "application/json"
    }

    response = requests.post(url, json=payload, headers=headers)

    print(response.json())
    ```

    ```javascript Publish a draft study
    const url = 'https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/';
    const options = {
      method: 'POST',
      headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
      body: '{"action":"PUBLISH"}'
    };

    try {
      const response = await fetch(url, options);
      const data = await response.json();
      console.log(data);
    } catch (error) {
      console.error(error);
    }
    ```

    ```go Publish a draft study
    package main

    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io"
    )

    func main() {

    	url := "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/"

    	payload := strings.NewReader("{\n  \"action\": \"PUBLISH\"\n}")

    	req, _ := http.NewRequest("POST", url, payload)

    	req.Header.Add("Authorization", "Token <token>")
    	req.Header.Add("Content-Type", "application/json")

    	res, _ := http.DefaultClient.Do(req)

    	defer res.Body.Close()
    	body, _ := io.ReadAll(res.Body)

    	fmt.Println(res)
    	fmt.Println(string(body))

    }
    ```

    ```ruby Publish a draft study
    require 'uri'
    require 'net/http'

    url = URI("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Post.new(url)
    request["Authorization"] = 'Token <token>'
    request["Content-Type"] = 'application/json'
    request.body = "{\n  \"action\": \"PUBLISH\"\n}"

    response = http.request(request)
    puts response.read_body
    ```

    ```java Publish a draft study
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")
      .header("Authorization", "Token <token>")
      .header("Content-Type", "application/json")
      .body("{\n  \"action\": \"PUBLISH\"\n}")
      .asString();
    ```

    ```php Publish a draft study
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('POST', 'https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/', [
      'body' => '{
      "action": "PUBLISH"
    }',
      'headers' => [
        'Authorization' => 'Token <token>',
        'Content-Type' => 'application/json',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp Publish a draft study
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "Token <token>");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\n  \"action\": \"PUBLISH\"\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```

    ```swift Publish a draft study
    import Foundation

    let headers = [
      "Authorization": "Token <token>",
      "Content-Type": "application/json"
    ]
    let parameters = ["action": "PUBLISH"] as [String : Any]

    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/60d9aadeb86739de712faee0/transition/")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data

    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()
    ```

    Once the study has successfully published, the study's `status` will be `ACTIVE`.

    When the expected number of submissions have been completed, the study's status will move to `AWAITING REVIEW`, you
    will need to review and approve the submissions to complete the study.

    If you are using completion paths to automate this process, the study will move to `COMPLETED` once all submissions
    have been automatically approved.
  </Step>

  <Step>
    ### Monitor the study's status

    Check the status of your study, using study `id` from step 2.

    ### Request

    GET [https://api.prolific.com/api/v1/studies/\{id}/](https://api.prolific.com/api/v1/studies/\{id}/)

    ```curl
    curl https://api.prolific.com/api/v1/studies/id/ \
         -H "Authorization: Token <token>"
    ```

    ```python
    import requests

    url = "https://api.prolific.com/api/v1/studies/id/"

    headers = {"Authorization": "Token <token>"}

    response = requests.get(url, headers=headers)

    print(response.json())
    ```

    ```javascript
    const url = 'https://api.prolific.com/api/v1/studies/id/';
    const options = {method: 'GET', headers: {Authorization: 'Token <token>'}};

    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/studies/id/"

    	req, _ := http.NewRequest("GET", url, nil)

    	req.Header.Add("Authorization", "Token <token>")

    	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/studies/id/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Token <token>'

    response = http.request(request)
    puts response.read_body
    ```

    ```java
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.get("https://api.prolific.com/api/v1/studies/id/")
      .header("Authorization", "Token <token>")
      .asString();
    ```

    ```php
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('GET', 'https://api.prolific.com/api/v1/studies/id/', [
      'headers' => [
        'Authorization' => 'Token <token>',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/studies/id/");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Token <token>");
    IRestResponse response = client.Execute(request);
    ```

    ```swift
    import Foundation

    let headers = ["Authorization": "Token <token>"]

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/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()
    ```

    Again, using the study `id`, check on how many submissions are in progress or have been completed.

    ### Request

    GET [https://api.prolific.com/api/v1/studies/\{id}/submissions/counts/](https://api.prolific.com/api/v1/studies/\{id}/submissions/counts/)

    ```curl
    curl https://api.prolific.com/api/v1/studies/id/submissions/counts/ \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json"
    ```

    ```python
    import requests

    url = "https://api.prolific.com/api/v1/studies/id/submissions/counts/"

    payload = {}
    headers = {
        "Authorization": "Token <token>",
        "Content-Type": "application/json"
    }

    response = requests.get(url, json=payload, headers=headers)

    print(response.json())
    ```

    ```javascript
    const url = 'https://api.prolific.com/api/v1/studies/id/submissions/counts/';
    const options = {
      method: 'GET',
      headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
      body: '{}'
    };

    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"
    	"strings"
    	"net/http"
    	"io"
    )

    func main() {

    	url := "https://api.prolific.com/api/v1/studies/id/submissions/counts/"

    	payload := strings.NewReader("{}")

    	req, _ := http.NewRequest("GET", url, payload)

    	req.Header.Add("Authorization", "Token <token>")
    	req.Header.Add("Content-Type", "application/json")

    	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/studies/id/submissions/counts/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Token <token>'
    request["Content-Type"] = 'application/json'
    request.body = "{}"

    response = http.request(request)
    puts response.read_body
    ```

    ```java
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.get("https://api.prolific.com/api/v1/studies/id/submissions/counts/")
      .header("Authorization", "Token <token>")
      .header("Content-Type", "application/json")
      .body("{}")
      .asString();
    ```

    ```php
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('GET', 'https://api.prolific.com/api/v1/studies/id/submissions/counts/', [
      'body' => '{}',
      'headers' => [
        'Authorization' => 'Token <token>',
        'Content-Type' => 'application/json',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/studies/id/submissions/counts/");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Token <token>");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```

    ```swift
    import Foundation

    let headers = [
      "Authorization": "Token <token>",
      "Content-Type": "application/json"
    ]
    let parameters = [] as [String : Any]

    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/id/submissions/counts/")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data

    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()
    ```
  </Step>

  <Step>
    ### Get the study's results

    Once the study has received enough responses, you can get the results using the export endpoint.

    ### Request

    POST [https://api.prolific.com/api/v1/studies/\{id}/demographic-export/](https://api.prolific.com/api/v1/studies/\{id}/demographic-export/)

    ```curl Export basic demographic data
    curl -X POST https://api.prolific.com/api/v1/studies/id/demographic-export/ \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json" \
         -d '{
      "filters": []
    }'
    ```

    ```python Export basic demographic data
    import requests

    url = "https://api.prolific.com/api/v1/studies/id/demographic-export/"

    payload = { "filters": [] }
    headers = {
        "Authorization": "Token <token>",
        "Content-Type": "application/json"
    }

    response = requests.post(url, json=payload, headers=headers)

    print(response.json())
    ```

    ```javascript Export basic demographic data
    const url = 'https://api.prolific.com/api/v1/studies/id/demographic-export/';
    const options = {
      method: 'POST',
      headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
      body: '{"filters":[]}'
    };

    try {
      const response = await fetch(url, options);
      const data = await response.json();
      console.log(data);
    } catch (error) {
      console.error(error);
    }
    ```

    ```go Export basic demographic data
    package main

    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io"
    )

    func main() {

    	url := "https://api.prolific.com/api/v1/studies/id/demographic-export/"

    	payload := strings.NewReader("{\n  \"filters\": []\n}")

    	req, _ := http.NewRequest("POST", url, payload)

    	req.Header.Add("Authorization", "Token <token>")
    	req.Header.Add("Content-Type", "application/json")

    	res, _ := http.DefaultClient.Do(req)

    	defer res.Body.Close()
    	body, _ := io.ReadAll(res.Body)

    	fmt.Println(res)
    	fmt.Println(string(body))

    }
    ```

    ```ruby Export basic demographic data
    require 'uri'
    require 'net/http'

    url = URI("https://api.prolific.com/api/v1/studies/id/demographic-export/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Post.new(url)
    request["Authorization"] = 'Token <token>'
    request["Content-Type"] = 'application/json'
    request.body = "{\n  \"filters\": []\n}"

    response = http.request(request)
    puts response.read_body
    ```

    ```java Export basic demographic data
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/studies/id/demographic-export/")
      .header("Authorization", "Token <token>")
      .header("Content-Type", "application/json")
      .body("{\n  \"filters\": []\n}")
      .asString();
    ```

    ```php Export basic demographic data
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('POST', 'https://api.prolific.com/api/v1/studies/id/demographic-export/', [
      'body' => '{
      "filters": []
    }',
      'headers' => [
        'Authorization' => 'Token <token>',
        'Content-Type' => 'application/json',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp Export basic demographic data
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/studies/id/demographic-export/");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "Token <token>");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\n  \"filters\": []\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```

    ```swift Export basic demographic data
    import Foundation

    let headers = [
      "Authorization": "Token <token>",
      "Content-Type": "application/json"
    ]
    let parameters = ["filters": []] as [String : Any]

    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/id/demographic-export/")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data

    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()
    ```
  </Step>

  <Step>
    ### Reviewing Submissions

    To complete a study and pay participants, you will need to review the submissions. You can get a list of submissions
    for your study using the study `id` from step 3.

    ### Request

    GET [https://api.prolific.com/api/v1/studies/\{id}/submissions/](https://api.prolific.com/api/v1/studies/\{id}/submissions/)

    ```curl
    curl https://api.prolific.com/api/v1/studies/id/submissions/ \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json"
    ```

    ```python
    import requests

    url = "https://api.prolific.com/api/v1/studies/id/submissions/"

    payload = {}
    headers = {
        "Authorization": "Token <token>",
        "Content-Type": "application/json"
    }

    response = requests.get(url, json=payload, headers=headers)

    print(response.json())
    ```

    ```javascript
    const url = 'https://api.prolific.com/api/v1/studies/id/submissions/';
    const options = {
      method: 'GET',
      headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
      body: '{}'
    };

    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"
    	"strings"
    	"net/http"
    	"io"
    )

    func main() {

    	url := "https://api.prolific.com/api/v1/studies/id/submissions/"

    	payload := strings.NewReader("{}")

    	req, _ := http.NewRequest("GET", url, payload)

    	req.Header.Add("Authorization", "Token <token>")
    	req.Header.Add("Content-Type", "application/json")

    	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/studies/id/submissions/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Get.new(url)
    request["Authorization"] = 'Token <token>'
    request["Content-Type"] = 'application/json'
    request.body = "{}"

    response = http.request(request)
    puts response.read_body
    ```

    ```java
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.get("https://api.prolific.com/api/v1/studies/id/submissions/")
      .header("Authorization", "Token <token>")
      .header("Content-Type", "application/json")
      .body("{}")
      .asString();
    ```

    ```php
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('GET', 'https://api.prolific.com/api/v1/studies/id/submissions/', [
      'body' => '{}',
      'headers' => [
        'Authorization' => 'Token <token>',
        'Content-Type' => 'application/json',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/studies/id/submissions/");
    var request = new RestRequest(Method.GET);
    request.AddHeader("Authorization", "Token <token>");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```

    ```swift
    import Foundation

    let headers = [
      "Authorization": "Token <token>",
      "Content-Type": "application/json"
    ]
    let parameters = [] as [String : Any]

    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/studies/id/submissions/")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "GET"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data

    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()
    ```

    Now you have the submissions you can process these as needed. To approve a submission, use the submission `id` from
    the response above and transition each submission to `APPROVED`.

    ### Request

    POST [https://api.prolific.com/api/v1/submissions/\{id}/transition/](https://api.prolific.com/api/v1/submissions/\{id}/transition/)

    ```curl Approving a submission
    curl -X POST https://api.prolific.com/api/v1/submissions/id/transition/ \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json" \
         -d '{
      "action": "APPROVE"
    }'
    ```

    ```python Approving a submission
    import requests

    url = "https://api.prolific.com/api/v1/submissions/id/transition/"

    payload = { "action": "APPROVE" }
    headers = {
        "Authorization": "Token <token>",
        "Content-Type": "application/json"
    }

    response = requests.post(url, json=payload, headers=headers)

    print(response.json())
    ```

    ```javascript Approving a submission
    const url = 'https://api.prolific.com/api/v1/submissions/id/transition/';
    const options = {
      method: 'POST',
      headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
      body: '{"action":"APPROVE"}'
    };

    try {
      const response = await fetch(url, options);
      const data = await response.json();
      console.log(data);
    } catch (error) {
      console.error(error);
    }
    ```

    ```go Approving a submission
    package main

    import (
    	"fmt"
    	"strings"
    	"net/http"
    	"io"
    )

    func main() {

    	url := "https://api.prolific.com/api/v1/submissions/id/transition/"

    	payload := strings.NewReader("{\n  \"action\": \"APPROVE\"\n}")

    	req, _ := http.NewRequest("POST", url, payload)

    	req.Header.Add("Authorization", "Token <token>")
    	req.Header.Add("Content-Type", "application/json")

    	res, _ := http.DefaultClient.Do(req)

    	defer res.Body.Close()
    	body, _ := io.ReadAll(res.Body)

    	fmt.Println(res)
    	fmt.Println(string(body))

    }
    ```

    ```ruby Approving a submission
    require 'uri'
    require 'net/http'

    url = URI("https://api.prolific.com/api/v1/submissions/id/transition/")

    http = Net::HTTP.new(url.host, url.port)
    http.use_ssl = true

    request = Net::HTTP::Post.new(url)
    request["Authorization"] = 'Token <token>'
    request["Content-Type"] = 'application/json'
    request.body = "{\n  \"action\": \"APPROVE\"\n}"

    response = http.request(request)
    puts response.read_body
    ```

    ```java Approving a submission
    import com.mashape.unirest.http.HttpResponse;
    import com.mashape.unirest.http.Unirest;

    HttpResponse<String> response = Unirest.post("https://api.prolific.com/api/v1/submissions/id/transition/")
      .header("Authorization", "Token <token>")
      .header("Content-Type", "application/json")
      .body("{\n  \"action\": \"APPROVE\"\n}")
      .asString();
    ```

    ```php Approving a submission
    <?php
    require_once('vendor/autoload.php');

    $client = new \GuzzleHttp\Client();

    $response = $client->request('POST', 'https://api.prolific.com/api/v1/submissions/id/transition/', [
      'body' => '{
      "action": "APPROVE"
    }',
      'headers' => [
        'Authorization' => 'Token <token>',
        'Content-Type' => 'application/json',
      ],
    ]);

    echo $response->getBody();
    ```

    ```csharp Approving a submission
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/submissions/id/transition/");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "Token <token>");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\n  \"action\": \"APPROVE\"\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```

    ```swift Approving a submission
    import Foundation

    let headers = [
      "Authorization": "Token <token>",
      "Content-Type": "application/json"
    ]
    let parameters = ["action": "APPROVE"] as [String : Any]

    let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

    let request = NSMutableURLRequest(url: NSURL(string: "https://api.prolific.com/api/v1/submissions/id/transition/")! as URL,
                                            cachePolicy: .useProtocolCachePolicy,
                                        timeoutInterval: 10.0)
    request.httpMethod = "POST"
    request.allHTTPHeaderFields = headers
    request.httpBody = postData as Data

    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()
    ```

    You can find more information on reviewing submissions in the [submissions
    guide](/api-reference/submissions/submissions-guide).
  </Step>
</Steps>

And that's it! You have successfully collected data using Prolific's API 🎉

## Help & support

[Prolific's researcher help center](https://researcher-help.prolific.com/en) has detailed guides on the core Prolific concepts.

For questions and requests specific to using Prolific's API, you can reach our support team through [this form](https://researcher-help.prolific.com/en/articles/476151-api-support).