Skip to content

Listing Service Packages

List service packages belonging to your workspace.

The list service package endpoint allows you to retrieve a paginated list of the service packages in your workspace. We also support filtering by id and time ranges.

Endpoint

MethodUrl
GET/v1.0/service-packages

Request Parameters

filter
string

The filter string. See the Filtering section for details on member filtering. Additionally, check the filtering documentation for more information.

page_size
number

The page size for search result pagination. If not provided, the service will default to 50 items.

page_token
string

The page to fetch. If any, this would be the next_page_token value returned from the previous request.

Sample Request

Copied
1curl -X GET 'https://api.worklayer.com/v1.0/service-packages' \
2-H 'Authorization: Bearer {token}'

Response

data
list

The service packages belonging to that workspace. See the service package reference page.

next_page_token
string

The pagination token to retrieve the next page of results. If the value is "", it means no further results for the request.

Sample Response

Copied
1{
2 "data": [
3 {
4 "id": "21e42d52-4145-465e-94bd-322c13bbe5fa",
5 "name": "1040 Tier 1",
6 "type": "PERSONAL",
7 "description": "Service Package Description",
8 "create_time": "2022-08-23T13:54:27.612477Z",
9 "modified_time": "2022-08-23T13:54:27.612477Z",
10 "required_questions": []
11 },
12 {
13 "id": "82c9366f-a34b-4315-a2a8-d88c3757d289",
14 "name": "1065 Business Return Services",
15 "type": "BUSINESS",
16 "description": "Service Package Description",
17 "create_time": "2022-08-23T13:54:27.612477Z",
18 "modified_time": "2022-08-23T13:54:27.612477Z",
19 "required_questions": []
20 }
21 ],
22 "next_page_token": "NDlmYmRlZjgtNThmNC00OTViLWI0ODItNDY5MzI2YzExOTA5LFBhY2thZ2UrVGVzdGluZytRdWVzdGlvbitUeXBlcw"
23}

Filtering

The following fields are supported:

FieldComparatorsDescriptionExample
id=The id of a service package.id = "21e42d52-4145-465e-94bd-322c13bbe5fa"
create_time=, !=, >, >=, <, <=The creation time of a service package.create_time >= "2022-01-01T12:00:00Z"
modified_time=, !=, >, >=, <, <=The modified time of a service package.modified_time =< "2022-12-31T23:59:59Z"

AND and OR are allowed when combining filters.

Sample Request with Filters

Copied
1curl -X GET 'https://api.worklayer.com/v1.0/service-packages?filter=id="21e42d52-4145-465e-94bd-322c13bbe5fa" OR id="82c9366f-a34b-4315-a2a8-d88c3757d289" \
2-H 'Authorization: Bearer {token}'

Errors

  1. Forbidden: API Client cannot list service packages.
  2. Unauthorized: API Client does not have valid credentials.
  3. BadRequest: Either the filter provided is in an incorrect format, or there was a malformed request.

Last updated on November 22, 2022