The token owner, business and scopes
GET
/api/v1/me
Any valid token. A good first call to check your setup.
Yanıtlar
200OK401Missing, invalid or expired token.403Token scope or staff permission missing.429Too many requests (120 per minute per token). Wait for the seconds in Retry-After.
curl
curl "https://your-restaurant.tavolify.com/api/v1/me" \
-H "Authorization: Bearer $TAVOLIFY_TOKEN" \
-H "Accept: application/json"
JavaScript
const response = await fetch('https://your-restaurant.tavolify.com/api/v1/me', {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.TAVOLIFY_TOKEN}`,
Accept: 'application/json',
},
});
const result = await response.json();
if (!response.ok) throw new Error(result.error ?? result.message);
console.log(result.data);
PHP
<?php
$ch = curl_init('https://your-restaurant.tavolify.com/api/v1/me');
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('TAVOLIFY_TOKEN'),
'Accept: application/json',
],
]);
$result = json_decode(curl_exec($ch), true);
$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if ($status >= 400) {
throw new RuntimeException($result['error'] ?? $result['message'] ?? 'HTTP ' . $status);
}
print_r($result['data']);
{
"data": {
"user": {
"id": 1,
"name": "Halil"
},
"business": {
"id": 7,
"name": "Demo Bistro",
"country": "PL",
"currency": "PLN",
"timezone": "Europe/Warsaw",
"locale": "pl"
},
"scopes": [
"orders:write",
"orders:read"
]
}
}
{
"message": "Unauthenticated."
}