Get API token
POST
/authenticate
const url = 'https://testomato.com/api/authenticate';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"user@email.com","password":"your-password","exp":"+1 hour"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://testomato.com/api/authenticate \ --header 'Content-Type: application/json' \ --data '{ "email": "user@email.com", "password": "your-password", "exp": "+1 hour" }'Generate API token
Request Body
Section titled “Request Body”Media typeapplication/json
object
email
User email
string
password
User password
string
exp
Expiration string. We do not recommend using long expirations; it’s safer to request a new API token.
Accepts the same values as PHP’s DateTime::modify() function: https://www.php.net/manual/en/datetime.modify.php
string
Example
{ "email": "user@email.com", "password": "your-password", "exp": "+1 hour"}Responses
Section titled “Responses”Successfully generated access token
Media typetext/plain
string
Example
eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c