Skip to main content
Create calendar resource by resource type
POST https://services.leadconnectorhq.com/calendars/resources/{resourceType}

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

resourceType
string
required
Calendar Resource Type

Body

locationId
string
required
name
string
required
description
string
required
quantity
number
required
Quantity of the equipment.
outOfService
number
required
Quantity of the out of service equipment.
capacity
number
required
Capacity of the room.
calendarIds
string[]
required
Service calendar IDs to be mapped with the resource.One equipment can only be mapped with one service calendar.One room can be mapped with multiple service calendars.

Respuestas

locationId
string
required
Account ID of the resource
name
string
default:"yoga room"
required
Name of the resource
resourceType
string
required
Posibles valores: ‘equipments’, ‘rooms’
isActive
boolean
required
Whether the resource is active
description
string
Description of the resource
quantity
number
Quantity of the resource
outOfService
number
default:"0"
Indicates if the resource is out of service
capacity
number
default:"85"
Capacity of the resource
calendarIds
string[]
required
Calendar IDs
{
  "locationId": "string",
  "name": "yoga room",
  "resourceType": "equipments",
  "isActive": true,
  "description": "string",
  "quantity": 0,
  "outOfService": 0,
  "capacity": 85,
  "calendarIds": [
    "Jsj0xnlDDjw0SuvX1J13",
    "oCM5feFC86FAAbcO7lJK"
  ]
}
{}
{}

Ejemplo

curl -X POST 'https://services.leadconnectorhq.com/calendars/resources/YOUR_resourceType' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "locationId": "string",
  "name": "string",
  "description": "string",
  "quantity": 0,
  "outOfService": 0,
  "capacity": 0,
  "calendarIds": [
    "string"
  ]
}'
const response = await fetch('https://services.leadconnectorhq.com/calendars/resources/YOUR_resourceType', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"locationId": "string", "name": "string", "description": "string", "quantity": 0, "outOfService": 0, "capacity": 0, "calendarIds": ["string"]}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'POST',
    'https://services.leadconnectorhq.com/calendars/resources/YOUR_resourceType',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"locationId": "string", "name": "string", "description": "string", "quantity": 0, "outOfService": 0, "capacity": 0, "calendarIds": ["string"]},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/calendars/resources/YOUR_resourceType');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'POST',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'locationId': 'string', 'name': 'string', 'description': 'string', 'quantity': 0, 'outOfService': 0, 'capacity': 0, 'calendarIds': ['string']}),
]);
$data = json_decode(curl_exec($ch), true);