MENU navbar-image

Introduction

Laravel API for the ZeroOCD Project (VU and Orb Amsterdam)

Hi Orb!

These are testing routes. While they won't save anything to the database, they'll still show actual response behavior.

Remove docs/ from these routes to get the paths to the actual routes.

They'll also require a secret value set in the body. For purpose of demonstration, the secret here is set to 1234, and the only user_id that is allowed is 1001.

Update 29-04-25: 10 more testing users have been added as requested.

Happy testing!

Authenticating requests

This API is not authenticated.

Endpoints

POST api/docs/login

Example request:
curl --request POST \
    "https://zeroocd.psy.vu.nl/api/docs/login" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"secret\": \"1234\",
    \"user_id\": \"1001\"
}"
const url = new URL(
    "https://zeroocd.psy.vu.nl/api/docs/login"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "secret": "1234",
    "user_id": "1001"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/docs/login

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

secret   required  optional  

string Hashed secret. Example: 1234

user_id   required  optional  

string The user ID of the participant of the participant. Example: 1001

POST api/docs/reply

Example request:
curl --request POST \
    "https://zeroocd.psy.vu.nl/api/docs/reply" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"secret\": \"1234\",
    \"user_id\": \"1001\",
    \"question_id\": \"RandomString\",
    \"answer\": \"Test\",
    \"datetime\": \"Test\"
}"
const url = new URL(
    "https://zeroocd.psy.vu.nl/api/docs/reply"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "secret": "1234",
    "user_id": "1001",
    "question_id": "RandomString",
    "answer": "Test",
    "datetime": "Test"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/docs/reply

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

secret   required  optional  

string Hashed secret. Example: 1234

user_id   required  optional  

string The user ID of the participant of the participant. Example: 1001

question_id   required  optional  

string The question id. Example: RandomString

answer   required  optional  

string The answer. Example: Test

datetime   required  optional  

string The datetime. Example: Test

POST api/docs/module

Example request:
curl --request POST \
    "https://zeroocd.psy.vu.nl/api/docs/module" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"secret\": \"1234\",
    \"user_id\": \"1001\",
    \"module_id\": \"Test\",
    \"duration\": \"Test\",
    \"datetime\": \"Test\"
}"
const url = new URL(
    "https://zeroocd.psy.vu.nl/api/docs/module"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "secret": "1234",
    "user_id": "1001",
    "module_id": "Test",
    "duration": "Test",
    "datetime": "Test"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/docs/module

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

secret   required  optional  

string Hashed secret. Example: 1234

user_id   required  optional  

string The user ID of the participant of the participant. Example: 1001

module_id   required  optional  

string The Module ID. Example: Test

duration   required  optional  

string The duration. Example: Test

datetime   required  optional  

string The datetime. Example: Test

POST api/docs/archoice

Example request:
curl --request POST \
    "https://zeroocd.psy.vu.nl/api/docs/archoice" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"secret\": \"1234\",
    \"user_id\": \"1001\",
    \"ar_type\": \"Test\",
    \"datetime\": \"Test\"
}"
const url = new URL(
    "https://zeroocd.psy.vu.nl/api/docs/archoice"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "secret": "1234",
    "user_id": "1001",
    "ar_type": "Test",
    "datetime": "Test"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/docs/archoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

secret   required  optional  

string Hashed secret. Example: 1234

user_id   required  optional  

string The user ID of the participant of the participant. Example: 1001

ar_type   required  optional  

string The AR type. Example: Test

datetime   required  optional  

string The datetime. Example: Test

POST api/docs/ar

Example request:
curl --request POST \
    "https://zeroocd.psy.vu.nl/api/docs/ar" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"secret\": \"1234\",
    \"user_id\": \"1001\",
    \"ar_type\": \"Test\",
    \"ar_level\": \"Test\",
    \"datetime\": \"Test\",
    \"duration\": \"Test\"
}"
const url = new URL(
    "https://zeroocd.psy.vu.nl/api/docs/ar"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "secret": "1234",
    "user_id": "1001",
    "ar_type": "Test",
    "ar_level": "Test",
    "datetime": "Test",
    "duration": "Test"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/docs/ar

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

secret   required  optional  

string Hashed secret. Example: 1234

user_id   required  optional  

string The user ID of the participant of the participant. Example: 1001

ar_type   required  optional  

string The AR type. Example: Test

ar_level   required  optional  

string The AR level. Example: Test

datetime   required  optional  

string The date. Example: Test

duration   required  optional  

string The duration. Example: Test

POST api/docs/disgustlevel

Example request:
curl --request POST \
    "https://zeroocd.psy.vu.nl/api/docs/disgustlevel" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"secret\": \"1234\",
    \"user_id\": \"1001\",
    \"ar_level\": \"Test\",
    \"ar_type\": \"Test\",
    \"datetime\": \"Test\",
    \"disgust_level\": \"Test\"
}"
const url = new URL(
    "https://zeroocd.psy.vu.nl/api/docs/disgustlevel"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "secret": "1234",
    "user_id": "1001",
    "ar_level": "Test",
    "ar_type": "Test",
    "datetime": "Test",
    "disgust_level": "Test"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/docs/disgustlevel

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

secret   required  optional  

string Hashed secret. Example: 1234

user_id   required  optional  

string The user ID of the participant of the participant. Example: 1001

ar_level   required  optional  

string The AR level. Example: Test

ar_type   required  optional  

string The AR type. Example: Test

datetime   required  optional  

string The date. Example: Test

disgust_level   required  optional  

string The level of disgust. Example: Test

POST api/docs/anxietylevel

Example request:
curl --request POST \
    "https://zeroocd.psy.vu.nl/api/docs/anxietylevel" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"secret\": \"1234\",
    \"user_id\": \"1001\",
    \"ar_level\": \"Test\",
    \"ar_type\": \"Test\",
    \"datetime\": \"Test\",
    \"anxiety_level_before_ar\": \"Test\",
    \"anxiety_level_after_ar\": \"Test\"
}"
const url = new URL(
    "https://zeroocd.psy.vu.nl/api/docs/anxietylevel"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "secret": "1234",
    "user_id": "1001",
    "ar_level": "Test",
    "ar_type": "Test",
    "datetime": "Test",
    "anxiety_level_before_ar": "Test",
    "anxiety_level_after_ar": "Test"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/docs/anxietylevel

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

secret   required  optional  

string Hashed secret. Example: 1234

user_id   required  optional  

string The user ID of the participant of the participant. Example: 1001

ar_level   required  optional  

string The AR level. Example: Test

ar_type   required  optional  

string The AR type. Example: Test

datetime   required  optional  

string The datetime. Example: Test

anxiety_level_before_ar   string  optional  

The anxiety level at the start. Example: Test

anxiety_level_after_ar   string  optional  

The anxiety level at the end. Example: Test

POST api/docs/daily

Example request:
curl --request POST \
    "https://zeroocd.psy.vu.nl/api/docs/daily" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --data "{
    \"secret\": \"1234\",
    \"user_id\": \"1001\",
    \"datetime\": \"Test\",
    \"anxiety_level\": \"Test\"
}"
const url = new URL(
    "https://zeroocd.psy.vu.nl/api/docs/daily"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "secret": "1234",
    "user_id": "1001",
    "datetime": "Test",
    "anxiety_level": "Test"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request      

POST api/docs/daily

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Body Parameters

secret   required  optional  

string Hashed secret. Example: 1234

user_id   required  optional  

string The user ID of the participant of the participant. Example: 1001

datetime   required  optional  

string The date. Example: Test

anxiety_level   required  optional  

string The anxiety level at the start of the session. Example: Test