Update calendar resource by ID
PUT https://services.leadconnectorhq.com/calendars/resources/{resourceType}/{id}
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación .
Version
string
default: "2021-07-28"
required
Versión de la API.
Path parameters
Body
Quantity of the equipment.
Quantity of the out of service equipment.
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
200 - Calendar resource updated
Account ID of the resource
name
string
default: "yoga room"
required
Name of the resource
Posibles valores: ‘equipments’, ‘rooms’
Whether the resource is active
Description of the resource
Indicates if the resource is out of service
{
"locationId" : "string" ,
"name" : "yoga room" ,
"resourceType" : "equipments" ,
"isActive" : true ,
"description" : "string" ,
"quantity" : 0 ,
"outOfService" : 0 ,
"capacity" : 85
}
Ejemplo
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 );