Introduction
GreenIT 2025 Feedback API
Hello Saori and Gert,
These are testing routes that work exactly like how they would in production, but
- they wont save anything to the database,
- and don't require the frontend to have an API_TOKEN set in it's environment (not hardcoded!)
The response behavior will be the same otherwise.
Remove the docs/ path segment from the routes you see to get the paths to the actual routes.
Note that the /docs/auth/response/remove endpoint only exists in this testing environment. Use it to clean up the test responses in the table when you're done.
The test responseId's for the current survey are
- R_8rvgqfsRwrvrU0Y
- R_8OkTUcNei8V6fYb
- R_8m4QRv1xidLB3bI
- R_8oaOoLHl3hU1ldp
Authenticating requests
To authenticate requests, include an Authorization
header with the value "Bearer {YOUR_AUTH_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your token by trying out the GET api/docs/token route below.
Endpoints
GET api/docs/token
Example request:
curl --request GET \
--get "https://api.green-it.nl/api/docs/token" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://api.green-it.nl/api/docs/token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"bearer": "34|3oqRaL34iBZH1WR00UitcleerND04GaS3gEHccBv9121bd4f"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/docs/auth/response
Example request:
curl --request POST \
"https://api.green-it.nl/api/docs/auth/response" \
--header "Authorization: Bearer 0|tokenincludingprecedingnumberandpipesymbol" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"responseId\": \"R_8rvgqfsRwrvrU0Y\"
}"
const url = new URL(
"https://api.green-it.nl/api/docs/auth/response"
);
const headers = {
"Authorization": "Bearer 0|tokenincludingprecedingnumberandpipesymbol",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"responseId": "R_8rvgqfsRwrvrU0Y"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/docs/auth/response/hash
Example request:
curl --request POST \
"https://api.green-it.nl/api/docs/auth/response/hash" \
--header "Authorization: Bearer 0|tokenincludingprecedingnumberandpipesymbol" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"responseId\": \"R_8rvgqfsRwrvrU0Y\"
}"
const url = new URL(
"https://api.green-it.nl/api/docs/auth/response/hash"
);
const headers = {
"Authorization": "Bearer 0|tokenincludingprecedingnumberandpipesymbol",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"responseId": "R_8rvgqfsRwrvrU0Y"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
POST api/docs/auth/response/remove
Example request:
curl --request POST \
"https://api.green-it.nl/api/docs/auth/response/remove" \
--header "Authorization: Bearer 0|tokenincludingprecedingnumberandpipesymbol" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"responseId\": \"R_8rvgqfsRwrvrU0Y\"
}"
const url = new URL(
"https://api.green-it.nl/api/docs/auth/response/remove"
);
const headers = {
"Authorization": "Bearer 0|tokenincludingprecedingnumberandpipesymbol",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"responseId": "R_8rvgqfsRwrvrU0Y"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.