curl https://tawked.com/v1/email/key \
-H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"const res = await fetch("https://tawked.com/v1/email/key", {
headers: {
Authorization: "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx",
},
});
const data = await res.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/email/key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
res = requests.get(
"https://tawked.com/v1/email/key",
headers={"Authorization": "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"},
)
data = res.json(){
"application": {
"id": "c2a10f3e-8b7a-4d2e-9c1a-1a2b3c4d5e6f",
"name": "Acme Store"
},
"can_send": true
}{
"error": "service_required"
}{
"error": "unauthorized"
}{
"error": "insufficient_scope"
}{
"error": "service_not_found"
}{
"error": "too_many_requests"
}{
"error": "internal_error"
}Check an email key
Checks that a key may send email: a live key with email:send on an application that may send. It sends and records nothing. The SMTP relay (smtp.tawked.com) calls it when a client signs in with its key as the password.
curl https://tawked.com/v1/email/key \
-H "Authorization: Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"const res = await fetch("https://tawked.com/v1/email/key", {
headers: {
Authorization: "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx",
},
});
const data = await res.json();<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://tawked.com/v1/email/key",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
res = requests.get(
"https://tawked.com/v1/email/key",
headers={"Authorization": "Bearer tk_live_xxxxxxxxxxxxxxxxxxxx"},
)
data = res.json(){
"application": {
"id": "c2a10f3e-8b7a-4d2e-9c1a-1a2b3c4d5e6f",
"name": "Acme Store"
},
"can_send": true
}{
"error": "service_required"
}{
"error": "unauthorized"
}{
"error": "insufficient_scope"
}{
"error": "service_not_found"
}{
"error": "too_many_requests"
}{
"error": "internal_error"
}Authorizations
Authorization: Bearer . An application key (tk_live_, tk_test_) has full access, which covers every product and any product added later, or custom access, chosen when the key is created: one or more of the scopes verify:check, verify:send (includes verify:check), notifications:read, notifications:send (includes notifications:read), email:read, email:send (includes email:read), notifications:templates (includes notifications:read). No key made on the API keys page holds notifications:templates, full access included: the three template writes answer such a key 403 insufficient_scope. A connected app's key holds it. A call outside the key's access answers 403 insufficient_scope and names the scope it needs in the WWW-Authenticate response header. A partner key (tk_partner_) always has full access. Whatever its access, a key is a server-side secret.
Query Parameters
Partner keys only: passed as a query parameter (?application=…), the partner's own id (external_id) for the application; the legacy name service is accepted identically.