> 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.

# Testing study set up

From the Prolific user interface, you can Preview how a participant will see your task. Look at the video tutorial [here](https://researcher-help.prolific.com/en/articles/445131-previewing-your-study).

For a more end-to-end participant experience, we now have a 'Test study as participant' feature. [Click here](https://researcher-help.prolific.com/en/articles/445134-test-study-as-a-participant) for a detailed breakdown of this feature, including tips on how to use it.

The 'Test study as a participant' feature is currently in a **limited beta release**. To be notified when this feature becomes more widely available, you can [register your interest](https://docs.google.com/forms/d/e/1FAIpQLSeFnReCu0H0qf5HKTZCBkgHkXsuOfSiLm4qmckZ2xv1N-dmkQ/viewform?usp=pp_url\&entry.155367885=Test+study+as+a+participant\&entry.811324050=Test+study+as+a+participant) here.

## Test study as participant via API

To 'Test study as participant' via the API, follow these steps:

<Steps>
  <Step>
    Create a test participant against a researcher account

    ### Request

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

    ```curl
    curl -X POST https://api.prolific.com/api/v1/researchers/participants/ \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json" \
         -d '{
      "email": "test.participant2024@prolific.co"
    }'
    ```

    ```python
    import requests

    url = "https://api.prolific.com/api/v1/researchers/participants/"

    payload = { "email": "test.participant2024@prolific.co" }
    headers = {
        "Authorization": "Token <token>",
        "Content-Type": "application/json"
    }

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

    print(response.json())
    ```

    ```javascript
    const url = 'https://api.prolific.com/api/v1/researchers/participants/';
    const options = {
      method: 'POST',
      headers: {Authorization: 'Token <token>', 'Content-Type': 'application/json'},
      body: '{"email":"test.participant2024@prolific.co"}'
    };

    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/researchers/participants/"

    	payload := strings.NewReader("{\n  \"email\": \"test.participant2024@prolific.co\"\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
    require 'uri'
    require 'net/http'

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

    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  \"email\": \"test.participant2024@prolific.co\"\n}"

    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.post("https://api.prolific.com/api/v1/researchers/participants/")
      .header("Authorization", "Token <token>")
      .header("Content-Type", "application/json")
      .body("{\n  \"email\": \"test.participant2024@prolific.co\"\n}")
      .asString();
    ```

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

    $client = new \GuzzleHttp\Client();

    $response = $client->request('POST', 'https://api.prolific.com/api/v1/researchers/participants/', [
      'body' => '{
      "email": "test.participant2024@prolific.co"
    }',
      'headers' => [
        'Authorization' => 'Token <token>',
        'Content-Type' => 'application/json',
      ],
    ]);

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

    ```csharp
    using RestSharp;

    var client = new RestClient("https://api.prolific.com/api/v1/researchers/participants/");
    var request = new RestRequest(Method.POST);
    request.AddHeader("Authorization", "Token <token>");
    request.AddHeader("Content-Type", "application/json");
    request.AddParameter("application/json", "{\n  \"email\": \"test.participant2024@prolific.co\"\n}", ParameterType.RequestBody);
    IRestResponse response = client.Execute(request);
    ```

    ```swift
    import Foundation

    let headers = [
      "Authorization": "Token <token>",
      "Content-Type": "application/json"
    ]
    let parameters = ["email": "test.participant2024@prolific.co"] as [String : Any]

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

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

    The email address supplied should not already have an associated Prolific account. Most email providers allow you to
    create an alias associated with your inbox, for example `name+prolificparticipant@example.com`.
  </Step>

  <Step>
    Reset the password on the participant account

    When the account is created, a randomly generated password is assigned to the participant account. Use [the password
    reset page](https://auth.prolific.com/u/reset-password/request/Username-Password-Authentication) to reset your
    password.
  </Step>

  <Step>
    Draft the study

    Create the study that you want to test before publishing.
  </Step>

  <Step>
    Create the test study

    ### Request

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

    ```curl
    curl -X POST https://api.prolific.com/api/v1/studies/id/test-study \
         -H "Authorization: Token <token>" \
         -H "Content-Type: application/json" \
         -d '{}'
    ```

    ```python
    import requests

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

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

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

    print(response.json())
    ```

    ```javascript
    const url = 'https://api.prolific.com/api/v1/studies/id/test-study';
    const options = {
      method: 'POST',
      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/test-study"

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

    	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
    require 'uri'
    require 'net/http'

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

    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 = "{}"

    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.post("https://api.prolific.com/api/v1/studies/id/test-study")
      .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('POST', 'https://api.prolific.com/api/v1/studies/id/test-study', [
      '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/test-study");
    var request = new RestRequest(Method.POST);
    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/test-study")! 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>
    Login with the participant account created in steps 1 & 2
  </Step>

  <Step>
    Take the test study as a participant
  </Step>

  <Step>
    To fix issues, update the draft study and repeat steps 4-6
  </Step>

  <Step>
    Once you're happy with all the study settings, publish the draft study
  </Step>
</Steps>

<Note title="Note">
  The 'Test study as participant' feature is in beta. Read the [help
  guide](https://researcher-help.prolific.com/en/articles/445134-test-study-as-a-participant) here to understand participant
  restrictions & how payments work with this feature.
</Note>