Skip to main content
POST
/
v1
/
auth
/
iframe-token
Generate Iframe Token
curl --request POST \
  --url https://api.whatabot.app/api/v1/auth/iframe-token \
  --header 'X-Api-Key: <x-api-key>'
import requests

url = "https://api.whatabot.app/api/v1/auth/iframe-token"

headers = {"X-Api-Key": "<x-api-key>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {'X-Api-Key': '<x-api-key>'}};

fetch('https://api.whatabot.app/api/v1/auth/iframe-token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.whatabot.app/api/v1/auth/iframe-token",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"X-Api-Key: <x-api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.whatabot.app/api/v1/auth/iframe-token"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("X-Api-Key", "<x-api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.whatabot.app/api/v1/auth/iframe-token")
.header("X-Api-Key", "<x-api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.whatabot.app/api/v1/auth/iframe-token")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["X-Api-Key"] = '<x-api-key>'

response = http.request(request)
puts response.read_body
{
  "ott": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_in": 30
}
Generate a one-time token (OTT) to authenticate an embedded iframe session. The token expires after a short period and can only be used once.
X-Api-Key
string
required
Your API key (prefixed with wh_).
{
  "ott": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_in": 30
}
This endpoint is used in the iframe embedding authentication flow. See the Iframe Embedding guide and the Embed Authentication page for more details.