Creates a new custom menu for a company. Requires authentication and proper permissions. For Icon Usage Details please refer to https://doc.clickup.com/8631005/d/h/87cpx-243696/d60fa70db6b92b2
POST https://services.leadconnectorhq.com/custom-menus/
Autorización
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.
Body
title
string
default:"Custom Menu"
required
Title of the custom menu
url
string
default:"https://custom-menus.com/"
required
URL of the custom menu
Icon information for the custom menu
showOnCompany
boolean
default:"True"
required
Whether the menu must be displayed on the agency’s level
showOnLocation
boolean
default:"True"
required
Whether the menu must be displayed for accounts level
showToAllLocations
boolean
default:"True"
required
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 POST 'https://services.leadconnectorhq.com/custom-menus/' \
-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/', {
method: 'POST',
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(
'POST',
'https://services.leadconnectorhq.com/custom-menus/',
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/');
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({'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);