Sign in and obtain an ID token
curl --request POST \
--url https://web-api.dev.soxai.site/api/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "developer@example.com",
"password": "<password>",
"returnSecureToken": true
}
'import requests
url = "https://web-api.dev.soxai.site/api/login"
payload = {
"email": "developer@example.com",
"password": "<password>",
"returnSecureToken": True
}
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({
email: 'developer@example.com',
password: '<password>',
returnSecureToken: true
})
};
fetch('https://web-api.dev.soxai.site/api/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"localId": "user123",
"email": "member@example.com",
"idToken": "<idToken>",
"refreshToken": "<refreshToken>",
"expiresIn": "3600",
"registered": true
}{
"error": "bad-request",
"error_msg": "Invalid input: <reason>"
}{
"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>"
}Authentication
Sign in and obtain an ID token
Not part of the Sandbox
A Sandbox key does not authenticate this endpoint and a Sandbox identity cannot complete it, because it issues or exposes credentials. It is published here because the Sandbox runs the same build. See Sandbox.
Sign in with a SOXAI app account and receive the tokens every other endpoint takes.
The call is forwarded to SOXAI Authentication; the response is that service’s answer, unchanged.
Parameters
- Body (
UserLogin):emailandpasswordof an account registered in the SOXAI app.
Response
200returnslocalId(the caller’s uid),idTokenandrefreshToken. SendidTokenasAuthorization: Bearer <idToken>. It expires in about one hour;refreshTokenlasts about a month and is exchanged for a newidTokenatPOST /api/refreshToken.- A rejected sign-in is reported in that body as well, so check its contents rather than only the status code.
Errors
- None specific to this endpoint. A rejected sign-in is reported inside the
200body, not as a status.
Authorization
- No authentication. This is where a caller obtains it.
POST
/
api
/
login
Sign in and obtain an ID token
curl --request POST \
--url https://web-api.dev.soxai.site/api/login \
--header 'Content-Type: application/json' \
--data '
{
"email": "developer@example.com",
"password": "<password>",
"returnSecureToken": true
}
'import requests
url = "https://web-api.dev.soxai.site/api/login"
payload = {
"email": "developer@example.com",
"password": "<password>",
"returnSecureToken": True
}
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({
email: 'developer@example.com',
password: '<password>',
returnSecureToken: true
})
};
fetch('https://web-api.dev.soxai.site/api/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"localId": "user123",
"email": "member@example.com",
"idToken": "<idToken>",
"refreshToken": "<refreshToken>",
"expiresIn": "3600",
"registered": true
}{
"error": "bad-request",
"error_msg": "Invalid input: <reason>"
}{
"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>"
}Body
application/json
Response
SOXAI Authentication's answer. Send idToken as Authorization: Bearer ; it lasts about an hour, while refreshToken lasts about a month and is exchanged at POST /api/refreshToken. A rejected sign-in is reported in this body too, so read its contents rather than only the status.