Quick Start
Prerequisites: Before beginning, it is essential to have a username and password enabled to access the endpoints. Each user has defined permissions determining which endpoints they can access.
User Security: Each user is unique, and ensuring the security of your account is entirely your responsibility. We recommend that you promptly change the temporary password you are given and keep your login information secure. Additionally, we advise regularly updating your password as needed.
Obtain your token for API authorization
Our API requests require authentication via a username and password, which generates a token. Any request lacking the token key will result in an error. Tokens can be generated using the login endpoint.
Important Note: The generated token is valid for 24 hours by default. It is crucial to implement mechanisms to re-validate access credentials in order to obtain a new token.
Login
POST https://[API_URL]/login
Perform user authentication and return a valid token.
Important Note: All requests must contain in the header the authorization token and the parameter "tenant" which by default is "logicsat" or otherwise it is supplied by us to each company.
Headers
Content-Type
application/json
tenant
logicsat
Body
email*
string
user email
password*
string
user password
Response
{
"authorization": {
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXV…"
}
}
{
"error": "Forbidden"
}
curl --location --request POST '[API_URL]/login' \
--header 'Content-Type: application/json' \
--header 'tenant: logicsat' \
--data-raw '{
"email": "***",
"password": "***"
}'
const axios = require('axios');
const data = {
email: '***',
password: '***'
};
axios.post('[API_URL]/login', data, {
headers: {
'Content-Type': 'application/json',
'tenant': 'logicsat'
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});
import requests
url = '[API_URL]/login'
headers = {
'Content-Type': 'application/json',
'tenant': 'logicsat'
}
data = {
'email': '***',
'password': '***'
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
namespace Example
{
class Program
{
static async Task Main(string[] args)
{
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "[API_URL]/login");
request.Headers.Add("Content-Type", "application/json");
request.Headers.Add("tenant", "logicsat");
request.Content = new StringContent("{\"email\":\"***\",\"password\":\"***\"}", Encoding.UTF8, "application/json");
var response = await client.SendAsync(request);
var responseBody = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseBody);
}
}
}
require 'net/http'
require 'json'
require 'uri'
uri = URI('[API_URL]/login')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri.path, {
'Content-Type' => 'application/json',
'tenant' => 'logicsat'
})
request.body = { email: '***', password: '***' }.to_json
response = http.request(request)
puts response.body
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.charset.StandardCharsets;
public class Main {
public static void main(String[] args) {
try {
URL url = new URL("[API_URL]/login");
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("Content-Type", "application/json");
con.setRequestProperty("tenant", "logicsat");
String jsonInputString = "{\"email\":\"[email protected]\",\"password\":\"your_password\"}";
con.setDoOutput(true);
try (OutputStream os = con.getOutputStream()) {
byte[] input = jsonInputString.getBytes(StandardCharsets.UTF_8);
os.write(input, 0, input.length);
}
int status = con.getResponseCode();
System.out.println("Response Code: " + status);
try (BufferedReader br = new BufferedReader(new InputStreamReader(con.getInputStream(), StandardCharsets.UTF_8))) {
StringBuilder response = new StringBuilder();
String responseLine;
while ((responseLine = br.readLine()) != null) {
response.append(responseLine.trim());
}
System.out.println("Response Body: " + response.toString());
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
Last updated