Example: Adding a User

This example walks you through adding a user to the Akana API Platform by using the API rather than the user interface. Only a Site Admin can perform this task.

This exercise assumes that you already have a valid login for the Akana API Platformand are a Site Admin.

Essentially, you'll just need to provide basic user information and run the operation.

Upon login, the new user will be required to complete one or more additional steps:

  1. Change password (always)
  2. Accept legal agreement (if a platform legal agreement is set up)
  3. Provide answer to user security challenge questions, if applicable.

Follow the detailed instructions below.

To add a user in the Akana API Platform using the API

  1. Log in via the API, POST /api/login operation, using your own email and password in the body of the operation instead of the placeholder values given below.
    • HTTP method: POST
    • URL: https://{hostname}/api/login
    • Accept header: application/json
    • Content-Type header: application/json
    • CSRF header: include it if needed. If you are not sure whether it's needed or not, refer to CSRF Prevention on the Platform.
    • Request Body:
      {
        "email":"MyEmailAddress",
        "password":"MyPassword"
      }
  2. Add the user, using the POST /api/users operation. In your API call, use the request body as shown below, and fill in valid values for the new user. Make sure the temporary password meets the password rules.
    • HTTP method: POST
    • URL: https://{hostname}/api/users
    • Content-Type header: application/json
    • CSRF header: include it if needed. If you are not sure whether it's needed or not, refer to CSRF Prevention on the Platform.
    • Request Body:
      {
        "FirstName":"TemporaryFirstName",
        "LastName":"TemporaryLastName",
        "Email":"useremail@example.com",
        "Password":"TemporaryPassword"
      }
  3. When done, remember to log out using the POST /api/login/logout operation. Use the following values:
    • URL: https://{hostname}/api/login/logout
    • Accept header: application/json
    • Content-Type header: application/x-www-form-urlencoded

Back to top

Related Topics