Pular para o conteúdo principal
POST
/
v1
/
auth
/
iframe-token
Gerar Token Iframe
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
}
Gera um token de uso único (OTT) para autenticar uma sessão embutida via iframe. O token expira após um curto período e só pode ser utilizado uma vez.
X-Api-Key
string
obrigatório
Sua chave de API (prefixada com wh_).
{
  "ott": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "expires_in": 30
}
Este endpoint é utilizado no fluxo de autenticação para incorporação via iframe. Consulte o guia de Incorporação via Iframe e a página de Autenticação de Incorporação para mais detalhes.