Login
Validate a signalId/signalToken pair and return a JWT that can be used to authorize other requests. The login token expires according to the returned ttl, expiresAt, and expiresIn fields; call this endpoint again when the token expires.
curl -X POST "https://api.nexus.usehardal.com/auth/login" \
-H "Content-Type: application/json" \
-d '{
"signalId": "example_string",
"signalToken": "example_string"
}'
import requests
import json
url = "https://api.nexus.usehardal.com/auth/login"
headers = {
"Content-Type": "application/json"
}
data = {
"signalId": "example_string",
"signalToken": "example_string"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://api.nexus.usehardal.com/auth/login", {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
"signalId": "example_string",
"signalToken": "example_string"
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"signalId": "example_string",
"signalToken": "example_string"
}`)
req, err := http.NewRequest("POST", "https://api.nexus.usehardal.com/auth/login", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.nexus.usehardal.com/auth/login')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request.body = '{
"signalId": "example_string",
"signalToken": "example_string"
}'
response = http.request(request)
puts response.body
{
"token": "eyJhbGc",
"signalId": "demo",
"ttl": 3600,
"issuedAt": 1782821338,
"expiresAt": 1782824938,
"expiresIn": 3600
}
/auth/login
Target server for requests. Edit to use your own host.
The media type of the request body
Signal identifier that will own the session
API token issued for the signal
Request Preview
Response
Response will appear here after sending the request
Body
Signal identifier that will own the session
API token issued for the signal
Responses
Signed JWT token
Signal identifier embedded in the token
Token time-to-live in seconds. The token expires after this duration.
Issued-at timestamp (seconds since Unix epoch)
Expiration timestamp (seconds since Unix epoch). Requests must use a fresh token after this time.
Remaining seconds until expiration at the time of the response.