Sign in a company user with a certificate
curl --request POST \
--url https://web-api.soxai.site/api/companies/users/login \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data ex_uid=external_123 \
--data 'signed_cer=<signed-certificate>'import requests
url = "https://web-api.soxai.site/api/companies/users/login"
payload = {
"ex_uid": "external_123",
"signed_cer": "<signed-certificate>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({ex_uid: 'external_123', signed_cer: '<signed-certificate>'})
};
fetch('https://web-api.soxai.site/api/companies/users/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"uid": "user123",
"token": {
"idToken": "<idToken>",
"refreshToken": "<refreshToken>",
"expiresIn": "3600"
}
}{
"error": "bad-request",
"error_msg": "Invalid certificate"
}{
"error": "not-found",
"error_msg": "User does not exist"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}Partner Companies
Sign in a company user with a certificate
Sign in a user the partner company registered, and return tokens for the SOXAI API.
Parameters
ex_uid(form, required) - the company’s identifier for the user.signed_cer(form, required) - the signing certificate, described below. It must be one issued for login.
Response
200returns the SOXAI user id, an access token, a refresh token and the expiry.
Errors
| Status | Condition |
|---|---|
| 400 | The certificate is invalid for this purpose |
| 404 | ex_uid names no user of this company |
Authorization
- No SOXAI user token. The caller authenticates with
signed_cer, a payload signed with the partner company’s private key and verified against the certificate SOXAI issued to that company. The certificate also fixes which company the request may act on. - A certificate that is unknown, revoked, expired, wrongly signed or issued for a different
purpose is refused with
400.
POST
/
api
/
companies
/
users
/
login
Sign in a company user with a certificate
curl --request POST \
--url https://web-api.soxai.site/api/companies/users/login \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data ex_uid=external_123 \
--data 'signed_cer=<signed-certificate>'import requests
url = "https://web-api.soxai.site/api/companies/users/login"
payload = {
"ex_uid": "external_123",
"signed_cer": "<signed-certificate>"
}
headers = {"Content-Type": "application/x-www-form-urlencoded"}
response = requests.post(url, data=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
body: new URLSearchParams({ex_uid: 'external_123', signed_cer: '<signed-certificate>'})
};
fetch('https://web-api.soxai.site/api/companies/users/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"uid": "user123",
"token": {
"idToken": "<idToken>",
"refreshToken": "<refreshToken>",
"expiresIn": "3600"
}
}{
"error": "bad-request",
"error_msg": "Invalid certificate"
}{
"error": "not-found",
"error_msg": "User does not exist"
}{
"error": "unprocessable-entity",
"error_msg": "body.<field>: <validation message>"
}{
"error": "rate-limited",
"error_msg": "Rate limit exceeded. Retry after <n> seconds."
}{
"error": "internal-server-error",
"error_msg": "Failed to fetch data: <error_message>"
}