Auth
Login
Authenticate users to access protected resources. Required for some endpoints.
Authenticate a user with a email and password.
POST /login HTTP/1.1
Host: mock.qbix.dev/api
Accept: application/json
Content-Type: application/json
{
"email": "string",
"password": "string"
}
Server will accept any email and password combination, as long as the email is in the correct format and password cannot be empty. If successful, a session cookie qbix-mock-session will be returned in the response header.
You are required to pass session cookie
qbix-mock-session in the header of all subsequent requests that requires authentication.Request
Body
Content-Type:
application/json| Property | Type | Description |
|---|---|---|
email | string | User's email. Can be anything as long as it is valid. |
password | string | User's password. Can be anything as long as it is not empty. |
Response
Body
Accepts:
application/json{
"error": null,
"data": {
"user": {
"email": "string",
"currency": "string"
}
}
}
| Property | Type | Description |
|---|---|---|
error | object or null | If there's an error, this will be returned. |
error.message | string | The error message. |
data | object or null | If successful, this will be returned. |
data.user | object | The user model object. |
data.user.email | string | The user's email. |
data.user.currency | string | The user's currency in ISO-3 format, i.e. AUD |