Updating Data

Users

External API clients can be given access to handle agency users. Get list of users, add users, remove users and change user details and passwords.

Get agency users

Fetch an array of users for the given Agency.

URI: https://<im4>/agency/{agency}/users
  • Request-type: GET
  • Parameters: {agency} (part of URI): ID of the agency
  • Return data: {users} (JSON)

Create agency user

Create a new user for agency, and returns the user object.

URI: https://<im4>/agency/{agency}/user
  • Request-type: POST
  • Parameters: {agency} - (part of URI) ID of the agency
    {firstname} (string) (required) : Users first name
    {lastname} (string): Users last name
    {email} (string) (valid email, required, unique): Users email
    {new_password} (string) (min 8 chars): Users password
    {new_password_confirmation} (string): Same as new_passord
  • Return data: {user} (JSON)
Password is not required. If not specified user can still get access through magic-links.

User can request access and set their own password through the 'Forgot passord' reset link

Get agency user

Fetch a user object.

URI: https://<im4>/agency/{agency}/user/{user}
  • Request-type: GET
  • Parameters:
    {agency} (part of URI): ID of the agency
    {user} (part of URI): ID of the user
  • Return data:{user} (JSON)

Update agency user

Update given user, and return updated user object.

URI: https://<im4>/agency/{agency}/user/{user}
  • Request-type: POST
  • Parameters:
    {agency} (part of URI): ID of the agency
    {user} (part of URI): ID of the user
    {firstname} (string|optional) : Users first name
    {lastname} (string|optional): Users last name
    {email} (string|optional|valid email|unique): Users email
    {new_password} (string|optional) (min 8 chars): Users password
  • Return data:{user} (JSON)
All parameters is optional and changes will only be made for included and set parameters.

Delete agency user

Delete a user.

URI: https://<im4>/agency/{agency}/user/{user}
  • Request-type: DELETE
  • Parameters:
    {agency} (part of URI): ID of the agency
    {user} (part of URI): ID of the user
  • Return data: HTTP 200 on success

Move user to another agency

Move a user. Since: 0.26

To move a user to another agency this agency has to be in the same agency group or the same profile group as current agency.
Read about fetching available agencies here
URI: https://<im4>/agency/{agency}/user/{user}/move
  • Request-type: POST
  • Parameters:
    {agency} (part of URI): ID of the agency
    {user} (part of URI): ID of the user
    {toAgency} (integer): ID of new agency
  • Return data: HTTP 200 on success