POST https://api.screenlab.io/auth
{
"email": "your_email@domain.com",
"password": "your_password"
}
async function getIdToken(email, password) {
const response = await fetch('https://api.screenlab.io/auth', {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({ email, password })
});
const data = await response.json();
return data.token;
}
function getIdToken($email, $password) {
$ch = curl_init('https://api.screenlab.io/auth');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'email' => $email,
'password' => $password
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
return $data['token'];
}
import requests
def get_id_token(email, password):
response = requests.post('https://api.screenlab.io/auth', json={
'email': email,
'password': password
})
data = response.json()
return data['token']
GET https://api.screenlab.io/scans/
Authorization: YOUR_ID_TOKEN
async function getScans(idToken) {
const response = await fetch('https://api.screenlab.io/scans/', {
headers: {
'Authorization': idToken
}
});
return await response.json();
}
function getScans($idToken) {
$ch = curl_init('https://api.screenlab.io/scans/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $idToken
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
import requests
def get_scans(id_token):
response = requests.get('https://api.screenlab.io/scans/', headers={
'Authorization': id_token
})
return response.json()
GET https://api.screenlab.io/scans/{id}
Authorization: YOUR_ID_TOKEN
async function getScan(idToken, scanId) {
const response = await fetch(`https://api.screenlab.io/scans/${scanId}`, {
headers: {
'Authorization': idToken
}
});
return await response.json();
}
function getScan($idToken, $scanId) {
$ch = curl_init("https://api.screenlab.io/scans/$scanId");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $idToken
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
import requests
def get_scan(id_token, scan_id):
response = requests.get(f'https://api.screenlab.io/scans/{scan_id}', headers={
'Authorization': id_token
})
return response.json()
POST https://api.screenlab.io/scans/
Authorization: YOUR_ID_TOKEN
Content-Type: application/json
{
"name": "Scan Name",
"url": "https://example.com",
"type": "overlay",
"location": "us",
"width": 1920,
"height": 1080,
"explanation": true // optional
}
async function createScanWithUrl(idToken, name, url, type, location, width, height) {
const response = await fetch('https://api.screenlab.io/scans/', {
method: 'POST',
headers: {
'Authorization': idToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({ name, url, type, location, width, height })
});
return await response.json();
}
function createScanWithUrl($idToken, $name, $url, $type, $location, $width, $height) {
$ch = curl_init('https://api.screenlab.io/scans/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'name' => $name,
'url' => $url,
'type' => $type,
'location' => $location,
'width' => $width,
'height' => $height
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $idToken,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
import requests
def create_scan_with_url(id_token, name, url, type, location, width, height):
response = requests.post('https://api.screenlab.io/scans/',
headers={
'Authorization': id_token,
'Content-Type': 'application/json'
},
json={
'name': name,
'url': url,
'type': type,
'location': location,
'width': width,
'height': height
}
)
return response.json()
POST https://api.screenlab.io/scans/
Authorization: YOUR_ID_TOKEN
Content-Type: application/json
{
"name": "Scan Name",
"imageData": "BASE64_ENCODED_IMAGE_DATA",
"type": "overlay"
}
async function createScanWithImage(idToken, name, imageData, type) {
const response = await fetch('https://api.screenlab.io/scans/', {
method: 'POST',
headers: {
'Authorization': idToken,
'Content-Type': 'application/json'
},
body: JSON.stringify({ name, imageData, type })
});
return await response.json();
}
function createScanWithImage($idToken, $name, $imageData, $type) {
$ch = curl_init('https://api.screenlab.io/scans/');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode([
'name' => $name,
'imageData' => $imageData,
'type' => $type
]));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: ' . $idToken,
'Content-Type: application/json'
]);
$response = curl_exec($ch);
curl_close($ch);
return json_decode($response, true);
}
import requests
def create_scan_with_image(id_token, name, image_data, type):
response = requests.post('https://api.screenlab.io/scans/',
headers={
'Authorization': id_token,
'Content-Type': 'application/json'
},
json={
'name': name,
'imageData': image_data,
'type': type
}
)
return response.json()