Query Information of Multiple Inbound Routes

Query the detailed information of multiple inbound routes at the same time.

Request URL

GET {base_url}/{api_path}/inbound_route/query?access_token={access_token}

Request parameters

Parameter Required Type Description
ids Yes String The unique ID(s) of the inbound route(s).
Note:

Response parameters

Parameter Type Description
errcode Integer Returned error code.
  • 0: Succeed.
  • Non-zero value: Failed.
Note: You can check the error code and error message in Error Code and Error Message.
errmsg String Returned message.
  • SUCCESS: Succeed.
  • FAILURE: Failed.
data Array<Inroute_Details> The detailed information of the inbound route.
Inroute_Details
Parameter Type Description
id Integer The unique ID of the inbound route.
name String The name of the inbound route.
alert_info String Inbound alert info.
did_option String DID matching mode.
  • patterns: Match DID patterns.
  • pattern_to_ext: Match DID pattern to extensions.
  • range_to_ext: Match DID Range to Extension range.
did_pattern_list Array<DID_Pattern_List> The DID matching pattern list when the did_option is patterns.
did_pattern_to_ext String The DID matching pattern to extensions when the did_option is pattern_to_ext.
did_to_ext_start String The start number of the DID matching pattern range when the did_option is range_to_ext.
did_to_ext_end String The end number of the DID matching pattern range when the did_option is range_to_ext.
did_pattern_to_ext_list Array <DID_Ext_List> The list of DID numbers and the corresponding extensions when the did_option is pattern_to_ext_list.
cid_option String Caller ID matching pattern.
  • patterns: Match Caller ID patterns.
  • phonebook: Match contacts' caller ID in specific phonebooks
cid_pattern_list Array<CID_Pattern_List> The Caller ID matching pattern list when the cid_option is patterns.
cid_to_phonebook Array<Integer> The ID of the selected phonebook when the cid_option is phonebook.
trunk_list Array<Trunk_List> The list of the selected trunk in the inbound route.
def_dest String Default destination.
  • disabled
  • end_call: Hang up
  • extension: Extension
  • pattern_to_ext: Match DID pattern to extensions
  • range_to_ext: Match DID range to extension range
  • pattern_to_ext_list: Match DID number(s) to extension(s) in one-to-one correspondence.
  • ext_vm: Extension voicemail
  • ivr: IVR
  • call_flow: Call Flow
  • ai_receptionist: AI receptionist
  • ring_group: Ring group
  • queue: Queue
  • group_vm: Group voicemail
  • conference: Conference
  • external_num: External number
  • outroute: Outbound route
  • play_greeting: Play greeting then hang up
  • fax_to_email: Fax to email
def_dest_prefix String This parameter returns different information depending on the def_dest.
  • When def_dest is external_num, this parameter displays the prefix of the external number.
  • When def_dest is play_greeting, this parameter displays the playback count of the greeting.
def_dest_value String This parameter returns different results depending on the def_dest.
  • When def_dest is external_num, this parameter displays the external number.
  • When def_dest is play_greeting, this parameter displays the prompt name.
  • When def_dest is range_to_ext, this parameter displays the extension range.
  • When def_dest is other destinations, this parameter displays the unique ID of the destination.

    For example, the destination is the extension 2002, then this field will return the ID of the extension 2002.

def_dest_ext_list Array<Ext_List> The selected extensions/extension groups when the def_dest is pattern_to_ext.
ringback_tone String The filename of custom prompt played for the caller before the extension user answers the call when the def_dest is extension.
enb_time_condition Integer Whether time condition is enabled.
  • 0: Disabled.
  • 1: Enabled.
timezone_id Integer Time zone ID.
time_condition String Time-based routing mode.
  • global: Inbound calls are routed based on global business hours.
  • route_scope: Inbound calls are routed based on custom business hours.
  • custom: Inbound calls are routed based on custom time periods.
time_condition_value Array<Custom_Time> Custom business hours or time periods.
business_hours_destination String

The destination for inbound calls received during business hours.

  • end_call: Hang Up.
  • extension: Extension.
  • ext_vm: Extension Voicemail.
  • group_vm: Group Voicemail.
  • outroute: Outbound Route.
  • ai_receptionist: AI Receptionist.
  • ring_group: Ring Group.
  • queue: Queue.
  • conference: Conference.
  • ivr: IVR.
  • call_flow: Call Flow.
  • external_num: External Number.
  • play_greeting: Play Prompt and Exit.
business_hours_destination_value String The detailed destination for inbound calls received during business hours.
Note: The definition of this parameter depends on the value of business_hours_destination.
  • If business_hours_destination is play_greeting, this parameter indicates the filename of custom prompt.
  • If business_hours_destination is extension, ext_vm, group_vm, ivr, call_flow, ring_group, conference, ai_receptionist, outroute, or queue, this parameter indicates the destination ID.
  • If business_hours_destination is external_num, this parameter indicates the external number.
outside_business_hours_destination String

The destination for inbound calls received outside business hours.

  • end_call: Hang Up.
  • extension: Extension.
  • ext_vm: Extension Voicemail.
  • group_vm: Group Voicemail.
  • outroute: Outbound Route.
  • ai_receptionist: AI Receptionist.
  • ring_group: Ring Group.
  • queue: Queue.
  • conference: Conference.
  • ivr: IVR.
  • call_flow: Call Flow.
  • external_num: External Number.
  • play_greeting: Play Prompt and Exit.
outside_business_hours_destination_value String The detailed destination for inbound calls received outside business hours.
Note: The definition of this parameter depends on the value of outside_business_hours_destination.
  • If outside_business_hours_destination is play_greeting, this parameter indicates the filename of custom prompt.
  • If outside_business_hours_destination is extension, ext_vm, group_vm, ivr, call_flow, ring_group, conference, ai_receptionist, outroute, or queue, this parameter indicates the destination ID.
  • If outside_business_hours_destination is external_num, this parameter indicates the external number.
holidays_hours_destination String

The destination for inbound calls received during holidays.

  • end_call: Hang Up.
  • extension: Extension.
  • ext_vm: Extension Voicemail.
  • group_vm: Group Voicemail.
  • outroute: Outbound Route.
  • ai_receptionist: AI Receptionist.
  • ring_group: Ring Group.
  • queue: Queue.
  • conference: Conference.
  • ivr: IVR.
  • call_flow: Call Flow.
  • external_num: External Number.
  • play_greeting: Play Prompt and Exit.
holidays_hours_destination_value String The detailed destination for inbound calls received during holidays.
Note: The definition of this parameter depends on the value of holidays_hours_destination.
  • If holidays_hours_destination is play_greeting, this parameter indicates the filename of custom prompt.
  • If holidays_hours_destination is extension, ext_vm, group_vm, ivr, call_flow, ring_group, conference, ai_receptionist, outroute, or queue, this parameter indicates the destination ID.
  • If holidays_hours_destination is external_num, this parameter indicates the external number.
enb_holiday_dest_ignore Integer Whether inbound calls received during holidays are routed according to the business hours destination.
  • 0: Disabled.
  • 1: Enabled.
enb_play_holiday_prompt_global Integer Whether holiday prompt is played before inbound calls received during holidays are routed to the holiday destination.
  • 0: Disabled.
  • 1: Enabled.
prefix_code String The prefix of the feature code to override time condition of the inbound route.
reset_code String The feature code used to switch the inbound route to the destination configured for the then-current time.
Note: This parameter returns a value only when time_condition is set to custom.
holiday_code String The feature code used to switch the inbound route to the holiday destination.
Note: This parameter returns a value only when time_condition is set to custom.
office_code String The feature code used to switch the inbound route to the default destination.
Note: This parameter returns a value only when time_condition is set to custom.
timezone_options Object<Timezone_List> The basic information of time zone.
DID_Pattern_List
Parameter Type Description
id Integer The unique ID of the DID pattern.
did_pattern String The DID matching rules.
DID_Ext_List
Parameter Type Description
id Integer The unique ID of the DID number matching rule.
did_pattern String The DID number.
did_pattern_to_ext String The ID of the extension that corresponds to the DID number.
CID_Pattern_List
Parameter Type Description
id Integer The unique ID of the Caller ID pattern.
cid_pattern String The Caller ID matching rules.
Trunk_List
Parameter Type Description
id Integer The unique ID of the selected trunk.
name String Trunk name.
type String Trunk type.
Ext_List
Parameter Type Description
value String The unique ID of the extension/extension group.
name String The name of the extension/extension group.
number String Extension number.
type String The type of the selected item.
  • extension
  • ext_group
Custom_Time
Parameter Type Description
id Integer The unique ID of the time period.
pos Integer The display order of the time period.
days_of_week Integer The days of the week to which the time period applies.
  • sun: Sunday
  • mon: Monday
  • tue: Tuesday
  • wed: Wednesday
  • thu: Thursday
  • fri: Friday
  • sat: Saturday
times Array<String> The time range of the time period.
months String The months to which the time period applies.
  • jan: January
  • feb: February
  • mar: March
  • apr: April
  • may: May
  • jun: June
  • jul: July
  • aug: August
  • sep: September
  • oct: October
  • nov: November
  • dec: December
days String The days of the month to which the time period applies.
dest String

The destination for inbound calls received during the time period.

  • end_call: Hang Up.
  • extension: Extension.
  • ext_vm: Extension Voicemail.
  • group_vm: Group Voicemail.
  • outroute: Outbound Route.
  • ai_receptionist: AI Receptionist.
  • ring_group: Ring Group.
  • queue: Queue.
  • conference: Conference.
  • ivr: IVR.
  • call_flow: Call Flow.
  • external_num: External Number.
  • play_greeting: Play Prompt and Exit.
dest_prefix String The destination prefix for inbound calls during the time period.
Note: This parameter returns value only when time_condition is set to custom or route_scope and dest is set to external_num or play_greeting.
  • If dest is set to external_num, this parameter indicates the dialing prefix prepended before external number.
  • If dest is set to play_greeting, this parameter indicates the number of times that the prompt will be played.
dest_value String The detailed destination for inbound calls received during the time period.
Note: The definition of this parameter depends on the value of dest.
  • If dest is play_greeting, this parameter indicates the filename of custom prompt.
  • If dest is extension, ext_vm, group_vm, ivr, call_flow, ring_group, conference, ai_receptionist, outroute, or queue, this parameter indicates the destination ID.
  • If dest is external_num, this parameter indicates the external number.
time_condition_switch Integer Whether advanced time settings are enabled for flexible scheduling based on a combination of week, month, and date.
  • 0: Disabled.
  • 1: Enabled.
Timezone_List
Parameter Type Description
name String Time zone name configured on PBX.
utc_offset String Time zone information, including the UTC offset and identifier.
timezone_info String Time zone display name.
value String Time zone ID.
type String Time zone type.
  • global
  • custom

Examples

Request example

GET /openapi/v1.0/inbound_route/query?ids=29,30&access_token=gYFPycZxVlJSmvMqylho3qBNz6QNWqHE HTTP/1.1

Host: yeastardocs.example.yeastarcloud.com

Response example

HTTP/1.1 200 OK
{
    "errcode": 0,
    "errmsg": "SUCCESS",
    "data": [
        {
            "id": 29,
            "name": "test4",
            "did_option": "patterns",
            "did_pattern_list": [
                {
                    "id": 45,
                    "did_pattern": "5503301"
                }
            ],
            "cid_option": "patterns",
            "trunk_list": [
                {
                    "id": 27,
                    "name": "test-peer-trunking",
                    "type": "peer"
                }
            ],
            "def_dest": "play_greeting",
            "def_dest_prefix": "2",
            "def_dest_value": "bruno-mars.wav",
            "ringback_tone": "",
            "enb_time_condition": 1,
            "timezone_id": 1,
            "time_condition": "route_scope",
            "time_condition_value": [
            {
                "id": 6,
                "pos": 1,
                "days_of_week": "mon tue wed thu fri",
                "times": [
                    "08:45-11:45",
                    "13:15-18:00"
                ],
                "months": "jan feb mar apr may jun jul aug sep oct nov dec",
                "days": "1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31",
                "dest": "",
                "dest_prefix": "",
                "dest_value": "",
                "time_condition_switch": 1
            },
            {
                "id": 7,
                "pos": 2,
                "days_of_week": "mon tue wed thu fri",
                "times": [
                    "11:45-13:15"
                ],
                "months": "",
                "days": "",
                "dest": "",
                "dest_prefix": "",
                "dest_value": "",
                "time_condition_switch": 0
            }
        },
        {
            "id": 30,
            "name": "test5",
            "did_option": "range_to_ext",
            "did_to_ext_start": "5503301",
            "did_to_ext_end": "5503310",
            "cid_option": "phonebook",
            "cid_to_phonebook": "[10]",
            "trunk_list": [
                {
                    "id": 28,
                    "name": "6700-account-trunking",
                    "type": "account"
                }
            ],
            "def_dest": "range_to_ext",
            "def_dest_value": "2001-2010",
            "ringback_tone": "",
            "enb_time_condition": 1,
            "timezone_id": 1,
            "time_condition": "global",
            "time_condition_value": null,
            "business_hours_destination": "extension",
            "business_hours_destination_value": "159",
            "outside_business_hours_destination": "group_vm",
            "outside_business_hours_destination_value": "1",
            "holidays_hours_destination": "ivr",
            "holidays_hours_destination_value": "1",
            "enb_holiday_dest_ignore": 0,
            "enb_play_holiday_prompt_global": 0,
            "prefix_code": "",
            "reset_code": "",
            "holiday_code": "",
            "office_code": "",
            "timezone_options": {
            "name": "Global Time Zone",
            "utc_offset": "UTC+8 Asia/Shanghai",
            "timezone_info": "8 China (Beijing)",
            "value": "1",
            "type": "global"
        }
        }
    ]
}