API
NOTE: API is an add-on feature of Workzone. For more details on upgrading your team's Workzone license, please contact us at help@workzone.com or call 610-275-9861.
Learn more about Workzone Enterprise.
Workzone has a robust API (Application Program Interface) which allows customers to access Workzone information from external sources.
Setting up API
Getting a token
curl --data "client_id=CLIENT_ID&client_secret=CLIENT_SECRET&grant_type=client_credentials" "https://[organization name].sharedwork.com/api/token"
{"access_token":"RmluZCBhbnl0aGluZyBpbnRlcmVzdGluZz8","expires_in":3600}
Calling the API
curl --header "Authorization: Bearer RmluZCBhbnl0aGluZyBpbnRlcmVzdGluZz8" "https://[organization name].sharedwork.com/api/test"
{"hostname":"[organization name].sharedwork.com",”currentDate":"Mon Aug 14 01:13:48 EDT 2017","message":"It worked!","user":"your email"}
Special Considerations & Limitations
Since some API requests can take several minutes to run, requiring significant processing power, an API Client cannot initiate an API call while it already has one in progress. If a call is initiated while another one is in progress, a "429 Too Many Requests" error message will appear.
The following API calls that have page and pageSize parameters:
- /projects
- /projects/tasks
- /projects/{projectID}/tasks
- /reports/statusByProject
- /reports/timeByProject
For those calls, the default page parameter is 1, and the maximum pageSize is 500. For responses that include more than 500 items, the call will need to be incremented to include additional pages. The page parameter will accept any non-zero integer.
Acceptable Use Policy
In order to ensure Workzone's API can maintain peak performance and security, we've laid out some basic guidelines for use. Please refer to our API Acceptable Use Policy for more information.