Get JWT token
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api-login \
--header 'Content-Type: application/json' \
--data '
{
"username": "edge-user-01",
"password": "<string>",
"uuid": "<string>",
"sessionId": "<string>",
"totpToken": "<string>"
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api-login"
payload = {
"username": "edge-user-01",
"password": "<string>",
"uuid": "<string>",
"sessionId": "<string>",
"totpToken": "<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({
username: 'edge-user-01',
password: '<string>',
uuid: '<string>',
sessionId: '<string>',
totpToken: '<string>'
})
};
fetch('https://studio.edgeimpulse.com/v1/api-login', 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://studio.edgeimpulse.com/v1/api-login",
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([
'username' => 'edge-user-01',
'password' => '<string>',
'uuid' => '<string>',
'sessionId' => '<string>',
'totpToken' => '<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://studio.edgeimpulse.com/v1/api-login"
payload := strings.NewReader("{\n \"username\": \"edge-user-01\",\n \"password\": \"<string>\",\n \"uuid\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"totpToken\": \"<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://studio.edgeimpulse.com/v1/api-login")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"edge-user-01\",\n \"password\": \"<string>\",\n \"uuid\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"totpToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api-login")
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 \"username\": \"edge-user-01\",\n \"password\": \"<string>\",\n \"uuid\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"totpToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"`{ \"success\": true, \"token\": \"A372jdhe.ad3r4gfrg\" }`"Get JWT token
Get a JWT token to authenticate with the API.
POST
/
api-login
Get JWT token
curl --request POST \
--url https://studio.edgeimpulse.com/v1/api-login \
--header 'Content-Type: application/json' \
--data '
{
"username": "edge-user-01",
"password": "<string>",
"uuid": "<string>",
"sessionId": "<string>",
"totpToken": "<string>"
}
'import requests
url = "https://studio.edgeimpulse.com/v1/api-login"
payload = {
"username": "edge-user-01",
"password": "<string>",
"uuid": "<string>",
"sessionId": "<string>",
"totpToken": "<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({
username: 'edge-user-01',
password: '<string>',
uuid: '<string>',
sessionId: '<string>',
totpToken: '<string>'
})
};
fetch('https://studio.edgeimpulse.com/v1/api-login', 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://studio.edgeimpulse.com/v1/api-login",
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([
'username' => 'edge-user-01',
'password' => '<string>',
'uuid' => '<string>',
'sessionId' => '<string>',
'totpToken' => '<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://studio.edgeimpulse.com/v1/api-login"
payload := strings.NewReader("{\n \"username\": \"edge-user-01\",\n \"password\": \"<string>\",\n \"uuid\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"totpToken\": \"<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://studio.edgeimpulse.com/v1/api-login")
.header("Content-Type", "application/json")
.body("{\n \"username\": \"edge-user-01\",\n \"password\": \"<string>\",\n \"uuid\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"totpToken\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://studio.edgeimpulse.com/v1/api-login")
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 \"username\": \"edge-user-01\",\n \"password\": \"<string>\",\n \"uuid\": \"<string>\",\n \"sessionId\": \"<string>\",\n \"totpToken\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body"`{ \"success\": true, \"token\": \"A372jdhe.ad3r4gfrg\" }`"Body
application/json
Username or e-mail address
Example:
"edge-user-01"
Password
Evaluation user UUID
Available options:
browser, cli Session ID
TOTP Token. Required if a user has multi-factor authentication with a TOTP token enabled. If a user has MFA enabled, but no totpToken is submitted; then an error starting with "ERR_TOTP_TOKEN IS REQUIRED" is returned. Use this to then prompt for an MFA token and re-login.
Was this page helpful?
⌘I