Saltar al contingut principal
GET

Obtenir horaris disponibles d'una ubicació

Scope:crm:booking-services.read
https://api.holded.com/api/v2/booking-locations/{locationId}/slots

Retorna els horaris disponibles per a un servei específic en una ubicació en un dia determinat.

Paràmetres

Paràmetres de ruta

locationIdstringobligatori

ID de la ubicació (ObjectId hexadecimal de 24 caràcters)

Paràmetres de consulta

service_idstringobligatori

Identificador del servei

daystring<date>obligatori

Data en format AAAA-MM-DD

Petició

python
import requests

url = "https://api.holded.com/api/v2/booking-locations/{locationId}/slots?service_id=value&day=2024-01-15"
headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Accept": "application/json",
}

response = requests.get(url, headers=headers)
print(response.json())

Respostes

Resposta

json
{
  "items": [
    {
      "from": "2024-01-15T10:30:00+01:00",
      "to": "2024-01-15T11:30:00+01:00",
      "duration": 3600
    }
  ],
  "form": [
    {
      "key": "name",
      "label": "Name",
      "type": "text",
      "required": true
    }
  ]
}

Respostes exitoses

200Llistat d'horaris disponiblesapplication/json
object
items[]object[]
fromstring<date-time>

Slot start in ISO 8601 format with timezone offset. Pass this value directly as `date_time` when creating a booking.

tostring<date-time>

Slot end in ISO 8601 format with timezone offset

durationinteger

Slot duration in seconds

form[]object[]

Booking form fields that must be collected from the user and passed as custom_fields when creating the booking.

keystring

Field key to use in custom_fields

labelstring

Human-readable field label

typestring

Field type

Enum:textnumberdateemailselectradiocheckbox
requiredboolean

Whether the field is required

Respostes d'error

400Sol·licitud incorrectaapplication/json
401API key no vàlida o no proporcionadaapplication/json
403Permisos insuficientsapplication/json
404Ubicació no trobadaapplication/json
429Límit de sol·licituds exceditapplication/json