The API is implemented as a set of REST calls. Where applicable, default values are in bold.
Responds with "Hello!"
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| --- |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | Hello! | |||
| 404 | Not Found |
Returns a timestamp
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| - |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | {"Timestamp": 1464949824} |
|||
| 404 | Not Found |
Returns a json object containing authorization information
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| Authorization | header | Contains the username and password | yes | string | |
| Content-Type* | header | Contains the body type required for MSAAD passthrough payloads | no | string | |
| client_id* | body | Specifies the requesting service client in the format “client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx” when using MSAAD passthrough. The client_id supplied here should be the requesting application client id as registered in Azure. The client_id needs to be explicitly enabled in the IMQS Auth system via configuration. | no | data-urlencode | |
| login_type* | body | Specifies the login type in the format “login_type=msaad” | no | data-urlencode |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | {"UserId":3618,"Identity":"joe@example.com","Roles":["2"]} |
|||
| 404 | Not Found |
* Direct auth login in environments where msaad is enabled is discouraged since OAuth is preferred. However, for some service-to-service integration MSAAD “passthrough” is required which allows a login with username and password as configured in AD. Fields marked with * above is required should this method be used.
Curl example of MSAAD passthrough login request (sensitive data replaced with x):
curl --location --request POST 'https://qa1.assetworld.co.za/auth2/login' \
--header 'Authorization: Basic xxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'client_id=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' \
--data-urlencode 'login_type=msaad'Sets expiry to past date and updates cookie.
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| - |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | Sets cookie expiry to past date | |||
| 404 | Not Found |
Returns a list of all nodes of the specified type at (or below - depending on flags) the specified level
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| - |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 404 | Not Found |
Returns a json object containing authorization information
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| Authorization | header | Contains the username and password | yes | string |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | {"UserId":3618,"Identity":"joe@example.com","Roles":["2"]} | |||
| 400 | Bad Request | ||||
| 401 | Unauthorized | ||||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| query | The email of the user you creating. email or username required, both are not | yes* | string | ||
| username | query | The username of the user you are creating. email or username required, both are not | yes* | string | |
| firstname | query | The first name of the user you are creating | no | string | |
| lastname | query | The last name of the user you are creating | no | string | |
| mobilenumber | query | The mobile number of the user you are creating | no | string | |
| telephonenumber | query | The telephone number of the user you are creating | no | string | |
| remarks | query | Any remarks required | no | string | |
| password | query | The password of the user you are creating | no | string | |
| * either email or username must be specified so that an identity can be created |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 401 | Unauthorized | ||||
| 403 | Forbidden | /auth2/create_user => "Identity may not be empty" "Identity already exists" |
|||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| query | The email of the user you creating. email or username required, both are not | yes | string | ||
| username | query | The username of the user you are creating. email or username required, both are not | yes | string | |
| firstname | query | The first name of the user you are creating | yes | string | |
| lastname | query | The last name of the user you are creating | yes | string | |
| mobilenumber | query | The mobile number of the user you are creating | no | string | |
| authusertype | query | The auth user type of the user account, be it IMQS, LDAP etc | yes | int |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 403 | Forbidden | ||||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| userid | query | The userid of the user you are archiving | yes | integer |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 403 | Forbidden | ||||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| groupname | query | The name of the group | yes | string |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 403 | Forbidden | ||||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| old | query | The old username | yes | string | |
| new | query | The new username | yes | string |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 403 | Forbidden | ||||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| groupname | query | The name of the group we want to set roles to | yes | string | |
| roles | query | The roles we want to assign to a group | no | string |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | /auth2/set_group_roles?groupname="test"&roles=500,501 | |||
| 400 | Bad Request | ||||
| 406 | Not Acceptable | ||||
| 404 | Not Found | /auth2/set_group_roles "Group '' not found: Group does not exist:" |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| userid | query | The userid of the user we want to set groups to | yes | integer | |
| groups | query | List of groups we want to give to the user | yes | string |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 403 | Forbidden | ||||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| userid | query | The userid of the user we want to set the password to | yes | integer | |
| password | query | The new password | yes | string |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 403 | Forbidden | ||||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| identity | query | The identity of the user who's password we want to reset | yes | string |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 404 | Not Found |
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| userid | query | The userid of the user who's password we want to reset | yes | integer | |
| X-NewPassword | header | The new password | yes | string | |
| X-ResetToken | header | The password token | yes | string |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | ||||
| 400 | Bad Request | ||||
| 404 | Not Found |
Returns a list of users just containing the users' identity and authorization, i.e. groups they belong to
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| - |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | [
] |
|||
| 500 | Internal Server Error | ||||
| 404 | Not Found |
Returns a list of user objects containing all the user's data and authorization.
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| - |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | [{
|
|||
| 500 | Internal Server Error | ||||
| 404 | Not Found |
Returns a list of groups and the roles they contain
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| - |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | [ { "Name": "PCS_Global", "Roles": [ "3" ], "ID": "13" }, { "Name": "DevelopmentControl", "Roles": [ "1124" ], "ID": "16" } ] | |||
| 500 | Internal Server Error | ||||
| 404 | Not Found |
Indicates if we're using active directory.
| Parameters | Name | In | Description | Required | Type |
|---|---|---|---|---|---|
| - |
| Responses | HTTP Status Code | Description | Schema | Headers | Example |
|---|---|---|---|---|---|
| 200 | Successful | 1 = yes; 0 = no | |||
| 404 | Not Found |