Update calendar resource by ID
http
PUT https://services.leadconnectorhq.com/calendars/resources/{resourceType}/{id}Authorization
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
Authorization | string | Yes | Bearer token generated from the Leadway portal. See Authentication. | |
Version | string | Yes | 2021-07-28 | API version. |
Path parameters
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
resourceType | string | Yes | Calendar Resource Type | |
id | string | Yes | Calendar Resource ID |
Body
| Name | Type | Required | Example | Description |
|---|---|---|---|---|
locationId | string | No | ||
name | string | No | ||
description | string | No | ||
quantity | number | No | Quantity of the equipment. | |
outOfService | number | No | Quantity of the out of service equipment. | |
capacity | number | No | Capacity of the room. | |
calendarIds | string[] | No | 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. | |
isActive | boolean | No |
Responses
200 - Calendar resource updated
locationId(string, required): Account ID of the resourcename(string, required): Name of the resource Example:yoga roomresourceType(string, required): Possible values: 'equipments', 'rooms'isActive(boolean, required): Whether the resource is activedescription(string): Description of the resourcequantity(number): Quantity of the resourceoutOfService(number): Indicates if the resource is out of service Example:0capacity(number): Capacity of the resource Example:85
json
{
"locationId": "string",
"name": "yoga room",
"resourceType": "equipments",
"isActive": true,
"description": "string",
"quantity": 0,
"outOfService": 0,
"capacity": 85
}400 - Bad Request
json
{}Example
curl -X PUT 'https://services.leadconnectorhq.com/calendars/resources/YOUR_resourceType/YOUR_id' \
-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"
],
"isActive": true
}'const response = await fetch('https://services.leadconnectorhq.com/calendars/resources/YOUR_resourceType/YOUR_id', {
method: 'PUT',
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"], "isActive": true}),
});
const data = await response.json();import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/calendars/resources/YOUR_resourceType/YOUR_id',
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"], "isActive": true},
)
data = response.json()<?php
$ch = curl_init('https://services.leadconnectorhq.com/calendars/resources/YOUR_resourceType/YOUR_id');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'PUT',
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'], 'isActive': true}),
]);
$data = json_decode(curl_exec($ch), true);