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.
You can get all the information regarding all contracts you have in your team just by sending requests to this URl
Copy code GET https://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}" }, {...} ]
If you need to get information regarding a specific contract, you need to add the {contract_id} at the end of the URL.
Copy code GET https://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}" }
You can update a contract information by sending
Copy code PUT https://www.webwork-tracker.com/rest-api/contracts
Your request should contain the following header
Copy code Content-Type: application/x-www-form-urlencoded
You can use
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}" }
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
Copy code POST https://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.
To delete a contract, you should send a request to the same URL using
Copy code DELETE https://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}" }