Managing Users
List of users
Gets a list of users that are attached to the location that the calling user has access to. You can also filter the results by using the query parameter in the url.
Url:
# gets a list of all the users accessible to the login user http://dailychex.meazureup.com/api-v2/users/ # gets a list of all users whose name, email or role matches Bob http://dailychex.meazureup.com/api-v2/users/?q=Bob
Method: GET
Response:
#success { "count": 10, # number of users in the results array ... "results": [ { "id": 1272, # id of the user "username": "user_a@yourcompany.com", "first_name": "", "last_name": "", "is_verified": false, # whether user has verified or not "roles": "GM", # role of the user. ... "location_ids": [ 2566 # user has access to the following locations ] }, {...}, # rest of the users ] } # error {"detail": "error description"}
Create User
Url:
http://dailychex.meazureup.com/api-v2/users/create/
Method: POST
Payload:
{ "username": "user_you_create@yourcompany.com", "name": "firstname lastname" }
Response:
#success { "id": 1463, # unique user id "username": "user_you_created@yourcompany.com", "first_name": "firstname", "last_name": "lastname", ... } #error {"detail": "error description"}
Delete User
Url:
# provide user_id of the user to delete in the url http://dailychex.meazureup.com/api-v2/users/<user_id>/delete/
Method: DELETE
Response:
# success None # error {"detail": "error description"}