Integrations
Let the docs site try API calls
PATCH
/api/integrations/docsAdmin. Needs an unlock token (
x-tempolight-token) while a PIN lock is set; without a lock, anyone can call it.Off by default: browsers may not call the API from other websites. On, the docs site (https://tempolight.pages.dev/docs) may send requests here from its API reference, with CORS for that address only; the PIN lock still applies.
Request body application/json
tryItbooleanAllow the docs site's Try it panel.
Responses
200OKapplication/json
tryItbooleanoriginsstring[]The docs site's addresses that may call the API.
400The body isn't valid JSON, or a value is wrong.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
403Locked, or not allowed.application/json
errorstringrequiredWhat went wrong, in a sentence for people.
Request
curl -X PATCH 'http://localhost:8080/api/integrations/docs' \
-H 'content-type: application/json' \
-d '{
"tryIt": true
}'const res = await fetch("http://localhost:8080/api/integrations/docs", {
method: "PATCH",
headers: { "content-type": "application/json" },
body: JSON.stringify({
"tryIt": true
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.patch(
"http://localhost:8080/api/integrations/docs",
json={
"tryIt": True
},
)
print(res.json())Response
{
"tryIt": true,
"origins": [
"https://tempolight.pages.dev",
"http://localhost:3000",
"http://127.0.0.1:3000"
]
}{
"error": "tryIt is true or false"
}{
"error": "Settings are locked. Unlock with the PIN in Settings."
}