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
PropertyTypeDescription
emailstringUser's email. Can be anything as long as it is valid.
passwordstringUser'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"
    }
  }
}
PropertyTypeDescription
errorobject or nullIf there's an error, this will be returned.
error.messagestringThe error message.
dataobject or nullIf successful, this will be returned.
data.userobjectThe user model object.
data.user.emailstringThe user's email.
data.user.currencystringThe user's currency in ISO-3 format, i.e. AUD

Copyright © 2024 Qbix Technology Sdn. Bhd. All rights reserved.