Authentication

AUTHENTICATION

Virtually all modules in our API require authentication for access. Authentication exchanges a username & password in exchange for a token to be used in all subsequent requests. Your first call for Authentication should be sent to API v1 endpoint:

https://www.humanity.com/api/

and must include the following details:

  • key - From application Admin tab >> Data API
  • username - Humanity username
  • password - Humanity password

If it is successful, the API will return status=1 as well as the token, and the employee profile and business details in the data field so you can use those immediately in your application. Here is an example of this exchange:

Request:

{
                 "key": "YOUR_API_KEY",
                 "module": "staff.login",
                 "method": "GET",
                 "username": "your_username",
                 "password": "your_password"              
            }

Response: (assuming successful login)

{
              "success": "1",
              "data": {
                        "employee": {
                        "name": "Ryan Fyfe",
                        "email": "[email protected]",
                        "etc": "..."
                   },
                  "business": {
                  "name": "Humanity Inc.",
                  "etc": "..."
                  }
        },
        "token": "xxxxxxx"
      }

Upon completion of successful login subsequent calls to the API require only the token for authentication; There is no need to pass the key, etc every time - Just the token.