Users


Use this REST API to administer and edit the managed accounts in your team. With this resource, it's possible to retrieve, update, create, delete users and also make other actions possible in WebWork account.
Below we provide an example of the data which is required for each scenario.

GET All users


You can get all the members in your team with the following URL request

Copy codeGEThttps://www.webwork-tracker.com/rest-api/users

The response returns a json format. Below you can see an example of response structure.

                Copy code
                [
                    {
                        "id": "{user_id}"
                        "fullname": "{user_fullname}"
                        "firstname": "{firstname}"
                        "lastname": "{lastname}"
                        "email": "{email}"
                        "avatar": "{avatar_url}"
                        "current_owner_id": "{current_owner_id}"
                        "deleted_at": "{deleted_at}"
                        "groups": [{groups}]
                    },
                    {...}
                ]
            

GET One user


If you need to get information regarding a specific user, you need to add the {user_id} at the end of the URL, or {user_email}

Copy codeGEThttps://www.webwork-tracker.com/rest-api/users/{user_id}
Copy codeGEThttps://www.webwork-tracker.com/rest-api/users?email={user_email}

The response returns a json format. Below you can see an example of response structure.

                Copy code
                {
                    "id": "{user_id}"
                    "email": "{email}"
                    "firstname": "{firstname}"
                    "lastname": "{lastname}"
                    "avatar": "{avatar_url}"
                    "current_role": "{current_role}"
                    "current_owner_id": "{current_owner_id}"
                    "timezone": "{timezone}"
                    "status": "{status}"
                    "team_name": "{team_name}"
                    "preferred_timezone": "{preferred_timezone}"
                    "settings_max_inactive_minutes": "{settings_max_inactive_minutes}"
                    "currency": "{currency}"
                    "rate_status": "{rate_status}"
                    "is_blocked": "{is_blocked}"
                    "weekly_hours_limit": "{weekly_hours_limit}"
                    "screenshots": "{screenshot_type}"
                    "created_at": "{created_at}"
                    "updated_at": "{updated_at}"
                    "deleted_at": "{deleted_at}"
                }
            

PUT Update user


Update team member or owner information by sending a PUT method request to the following URL and adding appropriate parameters.

Copy codePUThttps://www.webwork-tracker.com/rest-api/users

You should add the following header in your request

Copy codeContent-Type: application/x-www-form-urlencoded

Using PUT method you can update team member email, firstname, lastname, timezone, role, rate status and weekly hours limit

Property name Type Is required
email string NO
firstname string NO
lastname string NO
timezone string NO
role integer NO
rate_status boolean NO
weekly_hours_limit integer NO
remove_avatar boolean NO

The list of available values you can see below

Property name Value Explanation
role 20 Executive Manager
role 25 Project Manager
role 30 Employee

The returned response contains a success property with your request success value.

                Copy code
                {
                    "success": "{success_of_the_request}"
                }
            

POST Invite user


You can invite a new user using POST method and adding all necessary parameters to request body

Copy codePOSThttps://www.webwork-tracker.com/rest-api/users

The list of parameters you can give to body

Property name Type Is required
email string YES
firstname string YES
lastname string YES
role integer YES

The list of available values you can see below

Property name Value Explanation
role 20 Executive Manager
role 25 Project Manager
role 30 Employee
role 15 Project Viewer

The returned response includes a success property which contains your request success value.

                Copy code
                {
                    "success": "{success_of_the_request}"
                }
            

DELETE Archive user


You can archive a user by sending DELETE request to the following URL.
It will remove the user from the team members list and put it to archived members list.

See an example below

Copy codeDELETEhttps://www.webwork-tracker.com/rest-api/users/{user_id}

The returned response includes a success property which contains your request success value.

                Copy code
                {
                    "success": "{success_of_the_request}"
                }
            

GET Restore user


If you want to restore a user, you will need to send GET request to the URL mentioned below and add {user_id} at the end of it

Copy codeGEThttps://www.webwork-tracker.com/rest-api/users/restore/{user_id}

The returned response includes a success property which contains your request success value.

                Copy code
                {
                    "success": "{success_of_the_request}"
                }