Allo

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…

GET/v2/api/numbers/{number}/menu_options

Behavior

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 example 1>2.
  • label: the option's name in the call flow.
  • condition: a ready MENU_BRANCH condition for this option. It is always a MENU_BRANCH.

A line without a phone menu returns an empty list, and so does a line whose calls are not routed by the call-flow engine. Menu conditions are only accepted on lines where this list is not empty, and only with paths from it. On any other line, use a whole-line source with empty 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 in sources, 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

StatusCodeWhen
403ALLO_NUMBER_FORBIDDENThe caller cannot access this line

Authorization

Authorizationstring · headerrequired

Api-Key ak_live_…

Path parameters

numberstringrequired

Allo line in E.164 format. URL-encode the + as %2B.

Responses

200Menu options
dataobject[]
5 fields
node_idstringrequired

The menu node of the last step.

pathobject[]required

Menu choices from the first menu down to this option.

2 fields
node_idstringrequired

ID of the phone-menu node in the line's published call flow.

digitstringrequired

Key pressed at that menu.

digitsstringrequired

The same path as keys, separated by >.

labelstringrequired
conditionobjectrequired

Narrows a source to calls that went through part of the line's phone menu. A source holds at most 10 conditions, and an inbox at most 60 menu steps in all.

401
403
429