Login
curl --request POST \
--url https://api.wokelo.ai/auth/token/ \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"client_secret": "<string>",
"username": "<string>",
"password": "<string>",
"grant_type": "<string>"
}
'import requests
url = "https://api.wokelo.ai/auth/token/"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"username": "<string>",
"password": "<string>",
"grant_type": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '<string>',
client_secret: '<string>',
username: '<string>',
password: '<string>',
grant_type: '<string>'
})
};
fetch('https://api.wokelo.ai/auth/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.wokelo.ai/auth/token/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => '<string>',
'client_secret' => '<string>',
'username' => '<string>',
'password' => '<string>',
'grant_type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wokelo.ai/auth/token/"
payload := strings.NewReader("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"grant_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.wokelo.ai/auth/token/")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"grant_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wokelo.ai/auth/token/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"grant_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 2628288,
"token_type": "Bearer",
"scope": "read write",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
Login
Obtain a JSON Web Token (JWT) for subsequent API authentication
POST
/
auth
/
token
/
Login
curl --request POST \
--url https://api.wokelo.ai/auth/token/ \
--header 'Content-Type: application/json' \
--data '
{
"client_id": "<string>",
"client_secret": "<string>",
"username": "<string>",
"password": "<string>",
"grant_type": "<string>"
}
'import requests
url = "https://api.wokelo.ai/auth/token/"
payload = {
"client_id": "<string>",
"client_secret": "<string>",
"username": "<string>",
"password": "<string>",
"grant_type": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
client_id: '<string>',
client_secret: '<string>',
username: '<string>',
password: '<string>',
grant_type: '<string>'
})
};
fetch('https://api.wokelo.ai/auth/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.wokelo.ai/auth/token/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'client_id' => '<string>',
'client_secret' => '<string>',
'username' => '<string>',
'password' => '<string>',
'grant_type' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.wokelo.ai/auth/token/"
payload := strings.NewReader("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"grant_type\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
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.wokelo.ai/auth/token/")
.header("Content-Type", "application/json")
.body("{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"grant_type\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.wokelo.ai/auth/token/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"client_id\": \"<string>\",\n \"client_secret\": \"<string>\",\n \"username\": \"<string>\",\n \"password\": \"<string>\",\n \"grant_type\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 2628288,
"token_type": "Bearer",
"scope": "read write",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}
All API requests must be authenticated using a JWT token. Follow the steps below to generate your token:
Overview
Obtain a JSON Web Token (JWT) ffor subsequent API authenticationEndpoint Details
- Method: POST
- Endpoint:
/auth/token/
Request
Request Parameters
Submit the following parameters as form-data in the request body:Unique identifier for your organization, obtained from the API Credentials page
Secret key for your organization, obtained from the API Credentials page
Response
Response Fields
On successful authentication (HTTP 200), the response will contain:- Ensure the
client_idandclient_secretare kept confidential - Any token returned by the API is sensitive and should be stored securely. Wokelo tokens are long-lasting and should never be exposed on the client side.
- The access token is time-limited; use the refresh token to obtain a new access token when it expires
- Use HTTPS for all authentication requests
{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 2628288,
"token_type": "Bearer",
"scope": "read write",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}