Contracts


Simply get all information regarding your account contracts, update, delete and create new ones by using WebWork API. You can get all this information also for a specific project or a specific user. Below you can find examples in order easily can start using WebWork API and get the result you need.

GET All contracts


You can get all the information regarding all contracts you have in your team just by sending requests to this URl

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

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

                Copy code
                [
                    {
                        "id": "{contract_id}"
                        "user_id": "{user_id}"
                        "project_id": "{project_id}"
                        "notes": "{project_notes}"
                        "rate": "{rate}"
                        "weekly_hours_limit": "{weekly_hours_limit}"
                        "screenshots": "{screenshots_type}"
                        "created_at": "{created_at}"
                        "status": "{status}"
                        "updated_at": "{updated_at}"
                    },
                    {...}
                ]
            

GET One contract


If you need to get information regarding a specific contract, you need to add the {contract_id} at the end of the URL.

Copy codeGEThttps://www.webwork-tracker.com/rest-api/contracts/{contract_id}

The response should return in a json format. Example of response structure see below.

                {
                    "id": "{contract_id}"
                    "user_id": "{user_id}"
                    "project_id": "{project_id}"
                    "notes": "{project_notes}"
                    "rate": "{rate}"
                    "weekly_hours_limit": "{weekly_hours_limit}"
                    "screenshots": "{screenshots_type}"
                    "created_at": "{created_at}"
                    "status": "{status}"
                    "updated_at": "{updated_at}"
                }
            

PUT Update contract


You can update a contract information by sending PUT request to the following URL and giving appropriate parameters.

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

Your request should contain the following header

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

You can use PUT method to update a project name, start date, deadline, notes and estimation.

Property name Type Is required
weekly_hours_limit integer YES
screenshots string YES
rate integer YES

The screenshot property can accept only exact values. The list of available values you can see below

Property name Value Explanation
screenshots full Screenshot mode
screenshots no_screenshot No Screenshot mode
screenshots no_preview Background mode
screenshots blurred Blurred Screenshot mode

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

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

POST Create contract


In order to create a new contract, you should add project ID, the ID of a user, screenshots type, rate parameters to the request body using the POST method

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

Parameters that you can pass to the request body

Property name Type Is required
project_id integer YES
user_id integer YES
weekly_hours_limit integer NO
screenshots string NO
rate double NO

The screenshot property can accept only exact values. The list of available values you can find below

Property name Value Explanation
screenshots full Screenshot mode
screenshots no_screenshot No Screenshot mode
screenshots no_preview Background mode
screenshots blurred Blurred Screenshot mode

The returned response includes a success property which contains your request success value, and contract property which is an array of the created contract options.

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

In case of failure the response will include only success property.

DELETE Delete project


To delete a contract, you should send a request to the same URL using DELETE method and adding a {contract_id} at the end of it, see below.

Copy codeDELETEhttps://www.webwork-tracker.com/rest-api/contracts/{contract_id}

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

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