Listing Job Templates
List job templates available in your workspace.
The list job templates endpoint allows you to retrieve a paginated list of the job templates in your workspace. We also support filtering by id and time ranges.
Endpoint
Method | Url |
---|---|
GET | /v1.0/job-templates |
Request Parameters
The filter string. See the Filtering section for details on member filtering. Additionally, check the filtering documentation for more information.
The page size for search result pagination. If not provided, the service will default to 50 items.
The page to fetch. This would be the next_page_token
value returned from the previous request if any.
Sample Request
Copied1curl -X GET 'https://api.worklayer.com/v1.0/job-templates' \2-H 'Authorization: Bearer {token}'
Response
The job templates belonging to that workspace. See the job template reference page.
The pagination token to retrieve the next page of results. If the value is ""
, it means no further results for the request.
Sample Response
Copied1{2 "data": [3 {4 "id": "1c05a279-a8f5-4dd2-ad4f-52ba88ecdfb3",5 "name": "Job Template 1",6 "create_time": "2022-10-20T15:15:44.776867Z",7 "modified_time": "2022-10-20T15:15:44.776867Z",8 "supported_service_packages": []9 },10 {11 "id": "11f197aa-3066-4827-b998-e467d1bc5713",12 "name": "Job Template 2",13 "create_time": "2022-10-20T02:21:35.012015Z",14 "modified_time": "2022-10-20T02:21:35.012015Z",15 "supported_service_packages": [16 "c1d08beb-6846-4275-b7f7-674d0569e782"17 ]18 }19 ],20 "next_page_token": "MTFmMTk3YWEtMzA2Ni00ODI3LWI5OTgtZTQ2N2QxYmM1NzEzLDIwMjItMTAtMTlUMjIlM2EyMSUzYTM1LjAxMjAxNTAtMDQlM2EwMA"21}
Filtering
The following fields are supported:
Field | Comparators | Description | Example |
---|---|---|---|
id | = | The id of a job template. | id = "1c05a279-a8f5-4dd2-ad4f-52ba88ecdfb3" |
create_time | = , != , > , >= , < , <= | The creation time of a job template. | create_time >= "2022-01-01T12:00:00Z" |
modified_time | = , != , > , >= , < , <= | The modified time of a job template. | modified_time =< "2022-12-31T23:59:59Z" |
AND
and OR
are allowed when combining filters.
Sample Request with Filters
Copied1curl -X GET 'https://api.worklayer.com/v1.0/job-templates?filter=id="1c05a279-a8f5-4dd2-ad4f-52ba88ecdfb3" OR id="11f197aa-3066-4827-b998-e467d1bc5713" \2-H 'Authorization: Bearer {token}'
Errors
Forbidden
: API Client does not have permission to list job templates.Unauthorized
: API Client does not have valid credentials.BadRequest
: Either the filter that was provided is in an incorrect format, or there was a malformed request.