Users are people within a particular organization who administer, manage and view Moab.

Create

Beyond the initial User that’s automatically created when a new Organization is created, additional Users can be created in an Organization by a User with Creator Role permissions. The API JSON POST must contain the desired User first name, last name, description, unique email address, password, role, group, and whether or not the user agrees to terms and policies and is enabled in the body of the request. The API response will contain the User’s unique identity and security token which will be used to make all subsequent API calls by the new user.

RequestResponse
POST https://<moab url>/api/v1/userSuccess
{
“firstName”: “<first name>”,
“lastName”: “<last name>”,
“userDescription”: “<description>”,
“userEmailAddress”: “<user@mail.com>”,
“userPassword”: “<password>”,
“role”: <1,2 or 3>,
“userGroup”: <group id>,
“agreeToTermsAndPolicies”: <0 or 1>,
“enabled”: <0 or 1>
}
{
    “id”: <user id>,
    “securityToken”: <security token>,
    “status”: “success”,
    “message”: “user created”
}
Failure
{
“id”:”0″,
“status”:”error”,
“message”:”user creation failed”
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Unauthorized”,
“status”: 401,
“traceId”: “|…”
}
Curl
curl -L -X POST ‘https://<moab url>/api/v1/user’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’ \
–data-raw ‘{
“firstName”: “<first name>”,
“lastName”: “<last name>”,
“userDescription”: “<description>”,
“userEmailAddress”: “<user@mail.com>”,
“userPassword”: “<password>”,
“role”: <1,2 or 3>,
“userGroup”: <group id>,
“agreeToTermsAndPolicies”: <0 or 1>,
“enabled”: <0 or 1>
}’

Read All

To retrieve a list of all Users in a particular Organization, a User from that Organization with Reader Role permissions makes an API GET request with no parameters. The API JSON response contains repeating User identities, first and last names, descriptions, email addresses, roles, groups, and whether or not the users agreed to terms and policies and are enabled.

RequestResponse
GET https://<moab url>/api/v1/userSuccess
[
    {
        “id”: <user id>,
        “firstName”: “<first name>”,
        “lastName”: “<last name>”,
        “userDescription”: “<description>”,
        “userEmailAddress”: “<user@email.com>”,
        “role”: <1,2 or 3>,
        “userGroup”: <user group id>,
“agreeToTermsAndPolicies”: <0 or 1>,
        “enabled”: <0 or 1>
    },
    {
        “id”:  <user id>,
        “firstName”: “<first name>”,
        “lastName”: “<last name>”,
        “userDescription”: “<description>”,
        “userEmailAddress”: “<user@email.com>”,
        “role”: <1,2 or 3>,
        “userGroup”: <user group id>,
“agreeToTermsAndPolicies”: <0 or 1>,
        “enabled”: <0 or 1>
    }
]
Failure
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Not Found”,
“status”: 404,
“traceId”: “|…”
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Unauthorized”,
“status”: 401,
“traceId”: “|…”
}
Curl
curl -L -X GET ‘https://<moab url>/api/v1/User/’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’

Read One

To retrieve a User in a particular Organization, a User from that Organization with Reader Role permissions makes an API GET request with the User identity parameter at the end of the URL. The API JSON response contains the User identity, first and last name, description, email address, role, group, and whether or not the user agreed to terms and policies and is enabled.

RequestResponse
GET https://<moab url>/api/v1/user/<id>Success
{
    “id”: <user id>,
    “firstName”: “<first name>”,
    “lastName”: “<last name>”,
    “userDescription”: “<description>”,
    “userEmailAddress”: “<user@email.com>”,
    “role”: <1,2 or 3>,
    “userGroup”:  <user group id>,
“agreeToTermsAndPolicies”: <0 or 1>,
    “enabled”: <0 or 1>
}
Failure
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Not Found”,
“status”: 404,
“traceId”: “|…”
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “One or more validation errors occurred.”,
“status”: 400,
“traceId”: “|…”,
“errors”: { [ … ] }
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Unauthorized”,
“status”: 401,
“traceId”: “|…”
}
Curl
curl -L -X GET ‘https://<moab url>/api/v1/User/<id>’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’

Delete

To delete a User in a particular Organization, a User from that Organization with Creator or Contributor Role permissions makes an API DELETE request with the User identity parameter at the end of the URL. The API JSON response contains the User identity.

RequestResponse
DELETE https://<moab url>/api/v1/user/<id>Success
{
    “id”: <user id>,
    “status”: “success”,
    “message”: “user deleted”
}
Failures
{
“id”: <user id>,
“status”: “error”,
“message”: “user deletion failed”
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “One or more validation errors occurred.”,
“status”: 400,
“traceId”: “|…”,
“errors”: { [ … ] }
}
{
“type”: “https://tools.ietf.org/html/rfc…”,
“title”: “Unauthorized”,
“status”: 401,
“traceId”: “|…”
}
Curl
curl -L -X DELETE ‘https://<moab url>/api/v1/user/<id>’ \
-H ‘Content-Type: application/json’ \
-H ‘Authorization: Bearer <identity>.<security token>’