List menu options
curl --request GET \
--url https://api.withallo.com/v2/api/numbers/{number}/menu_options \
--header 'Authorization: <api-key>'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/menu_options"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.withallo.com/v2/api/numbers/{number}/menu_options', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/numbers/{number}/menu_options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/numbers/{number}/menu_options"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.withallo.com/v2/api/numbers/{number}/menu_options")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/menu_options")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"node_id": "node-1",
"path": [
{
"node_id": "node-1",
"digit": "1"
}
],
"digits": "1",
"label": "Website FR",
"condition": {
"type": "MENU_BRANCH",
"branches": [
[
{
"node_id": "node-1",
"digit": "1"
}
]
],
"include_no_choice": false
}
},
{
"node_id": "node-3",
"path": [
{
"node_id": "node-1",
"digit": "1"
},
{
"node_id": "node-3",
"digit": "2"
}
],
"digits": "1>2",
"label": "Sales",
"condition": {
"type": "MENU_BRANCH",
"branches": [
[
{
"node_id": "node-1",
"digit": "1"
},
{
"node_id": "node-3",
"digit": "2"
}
]
],
"include_no_choice": false
}
}
]
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Inboxes
List menu options
Flattens the phone-menu tree of the line’s published call flow. Each option carries a ready MENU_BRANCH condition. A line without a phone menu, or whose calls are not routed by the call-flow engine, returns an empty list. Menu conditions are only accepted on lines where this list is not empty.
GET
/
v2
/
api
/
numbers
/
{number}
/
menu_options
List menu options
curl --request GET \
--url https://api.withallo.com/v2/api/numbers/{number}/menu_options \
--header 'Authorization: <api-key>'import requests
url = "https://api.withallo.com/v2/api/numbers/{number}/menu_options"
headers = {"Authorization": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.withallo.com/v2/api/numbers/{number}/menu_options', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.withallo.com/v2/api/numbers/{number}/menu_options",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.withallo.com/v2/api/numbers/{number}/menu_options"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.withallo.com/v2/api/numbers/{number}/menu_options")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.withallo.com/v2/api/numbers/{number}/menu_options")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"node_id": "node-1",
"path": [
{
"node_id": "node-1",
"digit": "1"
}
],
"digits": "1",
"label": "Website FR",
"condition": {
"type": "MENU_BRANCH",
"branches": [
[
{
"node_id": "node-1",
"digit": "1"
}
]
],
"include_no_choice": false
}
},
{
"node_id": "node-3",
"path": [
{
"node_id": "node-1",
"digit": "1"
},
{
"node_id": "node-3",
"digit": "2"
}
],
"digits": "1>2",
"label": "Sales",
"condition": {
"type": "MENU_BRANCH",
"branches": [
[
{
"node_id": "node-1",
"digit": "1"
},
{
"node_id": "node-3",
"digit": "2"
}
]
],
"include_no_choice": false
}
}
]
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}{
"error": {
"type": "<string>",
"code": "<string>",
"message": "<string>",
"retryable": true,
"request_id": "<string>",
"retry_after_seconds": 123
}
}Required scope:
INBOXES_READBehavior
Flattens the phone-menu tree of the line’s published call flow. Drafts are ignored. Each option gives:path: the menu choices from the first menu down to this option.digits: the same path as keys, for example1>2.label: the option’s name in the call flow.condition: a readyMENU_BRANCHcondition for this option. It is always aMENU_BRANCH.
conditions.
Use it only to build a custom branch. For the common case, start from Get inbox suggestions.
Combine several options
A line appears once insources, with at most one MENU_BRANCH. To cover several options of the same line, concatenate the branches of their conditions into one MENU_BRANCH:
{
"allo_number": "+33612345678",
"conditions": [
{
"type": "MENU_BRANCH",
"branches": [
[{"node_id": "node-1", "digit": "1"}, {"node_id": "node-3", "digit": "2"}],
[{"node_id": "node-1", "digit": "2"}]
],
"include_no_choice": false
}
]
}
Errors
| Status | Code | When |
|---|---|---|
403 | ALLO_NUMBER_FORBIDDEN | The caller cannot access this line |
Was this page helpful?