QIMA Logo
API Reference

8 categories • 44 endpoints

  • All APIs

    44


  • Authentication
    v1.0.0

    Get token

    Request

    Query Parameters
    NameTypeLocationRequiredDescription
    refreshstringqueryNoSet to `true` to bypass the server cache and fetch the latest customer profile. Defaults to cached data.

    Request Body

    Content-Type: application/json

    FieldTypeRequiredDescription
    accountstringYes
    Username/Login
    passwordstringYes
    Your own account password, MD5-hashed. The hashed value is a 32-character lowercase hexadecimal string. Never send the plain-text password.
    userTypestringYes
    Account type, can be client or employee
    Enum: "client", "employee"
    tokenExpirestringNo
    Seconds that the token expected to expire, numbers only, must < 2592000(30 days)
    Responses

    200
    Authorized token, token refresh key, token expire unix timestamp, customer/employee profile are returned

    Content-Type: application/json

    message
    string
    FieldTypeDescription
    messagestring
    FieldTypeDescription
    {
      "message": null,
      "content": {
        "token": {
          "id": "C0EAB3901FBF4AEF8580195C73B585FA",
          "userId": "4C6E94072DFC4918B60752F701DE544A",
          "userType": "client",
          "token": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5IjoiSldUIn0..<truncated-jwt>",
          "validBefore": "1783051410",
          "refreshKey": "<token-refresh-key>",
          "loginType": "Login"
        },
        "user": {
          "id": "4C6E94072DFC4918B60752F701DE544A",
          "login": "apiuser001",
          "firstName": "Demo",
          "lastName": "User",
          "email": "test.user@example.com",
          "status": "ACTIVE",
          "businessUnit": "CIS",
          "company": {
            "id": "23EC09AB0F3C46BBA4F79718DCED16D0",
            "name": "PP-Testing-77729",
            "country": "China",
            "companyType": "client"
          }
        }
      }
    }

    Content-Type: application/json


    Content-Type: application/json

    {
      "message": "The Username and Password don't match.",
      "content": null
    }

    Content-Type: application/json

    POST
    /auth/v2/token
    Request samples

    application/json

    { "account": "apiuser001", "password": "e10adc3949ba59abbe56e057f20f883e", "userType": "client" }

    Response samples

    application/json

    { "message": null, "content": { "token": { "id": "C0EAB3901FBF4AEF8580195C73B585FA", "userId": "4C6E94072DFC4918B60752F701DE544A", "userType": "client", "token": "eyJhbGciOiJkaXIiLCJlbmMiOiJBMTI4Q0JDLUhTMjU2IiwiY3R5IjoiSldUIn0..<truncated-jwt>", "validBefore": "1783051410", "refreshKey": "<token-refresh-key>", "loginType": "Login" }, "user": { "id": "4C6E94072DFC4918B60752F701DE544A", "login": "apiuser001", "firstName": "Demo", "lastName": "User", "email": "test.user@example.com", "status": "ACTIVE", "businessUnit": "CIS", "company": { "id": "23EC09AB0F3C46BBA4F79718DCED16D0", "name": "PP-Testing-77729", "country": "China", "companyType": "client" } } } }