List all services of a center
This API helps you to retrieve all the services that are active in a center.
You must specify the appropriate details for the center_id paramter in the API request.
You can also use the expand parameter in the API request to specify details for the additional_info, catalog_info, category_id, variants_info, add_ons_info, and image_paths parameters. The category_id parameter enables you to filter services according to their respective category or sub-category.
In addition, you can use the pagination feature by passing page and size query parameters if you have a large number of records. By default, page is set as 1 and size is set as 10. Size cannot be more than 100: which means that the maximum records per page cannot be more than 100.
Before you begin
- You need a valid API key or access token. See Set up API authentication.
Permission: Manage API Keys (on the Administrator security object) — Required to access Zenoti APIs.
Endpoint
GET /v1/Centers/{center_id}/services
Base URL: https://api.zenoti.com
Request
Headers
| Header | Required | Description |
|---|---|---|
| Authorization | Yes | bearer {{access_token}} |
Path parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| center_id | string | Yes | Mandatory Unique 32-character identifier of the center. |
Query parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| only_add_ons | boolean | No | — | Optional If passed as true, this parameter retrives only add-on services. Default value is false. |
| catalog_enabled | boolean | No | — | Optional If passed as true, this parameter retrieves only catalog-enabled services. Default value is false. |
| category_id | string | No | — | Optional Filters the services of the center according to their respective category_id or sub-category_id values. |
| page | integer (int32) | No | 1 | Optional Number of the center's services to be displayed per page. Default value for this parameter is 10 and the maximum value is 100. |
| size | integer (int32) | No | 10 | Optional Number of the center's services to be displayed per page. Default value for this parameter is 10 and the maximum value is 100. |
| expand | string | No | — | Returns extra fields. Supported: additional_info, catalog_info, category_id, variants_info, add_ons_info, image_paths, tags. |
Response
Success (200 OK)
{}
Example
curl --request GET \
--url 'https://api.zenoti.com/v1/Centers/{center_id}/services' \
--header 'Authorization: bearer {{access_token}}'
const response = await fetch('https://api.zenoti.com/v1/Centers/{center_id}/services', {
method: 'GET',
headers: {
'Authorization': 'bearer {{access_token}}'
},
});
const data = await response.json();
import requests
response = requests.get(
'https://api.zenoti.com/v1/Centers/{center_id}/services',
headers={
'Authorization': 'bearer {{access_token}}',
},
)
data = response.json()
using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "bearer {{access_token}}");
var response = await client.GetAsync(
"https://api.zenoti.com/v1/Centers/{center_id}/services");
var data = await response.Content.ReadAsStringAsync();
require 'net/http'
require 'json'
uri = URI('https://api.zenoti.com/v1/Centers/{center_id}/services')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Authorization'] = 'bearer {{access_token}}'
response = http.request(request)
data = JSON.parse(response.body)
Error codes
| Status | Description |
|---|---|
| 401 | Unauthorized -- invalid or expired access token |
| 429 | Too many requests -- rate limit exceeded |