Updates an existing custom menu for a given company. Requires authentication and proper permissions.
PUT https://services.leadconnectorhq.com/custom-menus/{customMenuId}
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
ID of the custom menu to update
Body
title
string
default:"Custom Menu"
Title of the custom menu
url
string
default:"https://custom-menus.com/"
URL of the custom menu
Icon information for the custom menu
Whether the menu must be displayed on the agency’s level
Whether the menu must be displayed for accounts level
Whether the menu must be displayed to all accounts
Mode for opening the menu link Posibles valores: ‘iframe’, ‘new_tab’, ‘current_tab’
List of account IDs where the menu should be shown. This list is applicable only when showOnLocation is true and showToAllLocations is false
Which user-roles should the menu be accessible to? Posibles valores: ‘all’, ‘admin’, ‘user’
Whether to allow camera access (only for iframe mode)
Whether to allow microphone access (only for iframe mode)
Respuestas
400 - Bad Request - Invalid input
403 - Forbidden - Insufficient permissions
422 - Unprocessable Entity
Ejemplo
curl -X PUT 'https://services.leadconnectorhq.com/custom-menus/YOUR_customMenuId' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"title": "Custom Menu",
"url": "https://custom-menus.com/",
"showOnCompany": true,
"showOnLocation": true,
"showToAllLocations": true,
"openMode": "iframe",
"locations": [
"gfWreTIHL8pDbggBb7af",
"67WreTIHL8pDbggBb7ty"
],
"userRole": "all",
"allowCamera": false,
"allowMicrophone": false
}'
const response = await fetch('https://services.leadconnectorhq.com/custom-menus/YOUR_customMenuId', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"title": "Custom Menu", "url": "https://custom-menus.com/", "showOnCompany": true, "showOnLocation": true, "showToAllLocations": true, "openMode": "iframe", "locations": ["gfWreTIHL8pDbggBb7af", "67WreTIHL8pDbggBb7ty"], "userRole": "all", "allowCamera": false, "allowMicrophone": false}),
});
const data = await response.json();
import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/custom-menus/YOUR_customMenuId',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"title": "Custom Menu", "url": "https://custom-menus.com/", "showOnCompany": true, "showOnLocation": true, "showToAllLocations": true, "openMode": "iframe", "locations": ["gfWreTIHL8pDbggBb7af", "67WreTIHL8pDbggBb7ty"], "userRole": "all", "allowCamera": false, "allowMicrophone": false},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/custom-menus/YOUR_customMenuId');
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({'title': 'Custom Menu', 'url': 'https://custom-menus.com/', 'showOnCompany': true, 'showOnLocation': true, 'showToAllLocations': true, 'openMode': 'iframe', 'locations': ['gfWreTIHL8pDbggBb7af', '67WreTIHL8pDbggBb7ty'], 'userRole': 'all', 'allowCamera': false, 'allowMicrophone': false}),
]);
$data = json_decode(curl_exec($ch), true);