News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
/account/~/directory/entries not returning IVR Menus
Tags: rest api, contacts
Jan 24, 2021 at 5:10pm   •   2 replies  •  0 likes
ryan-barnes

Attempting to use the RestAPI's to get all the company directory. We have ~50 IVR Menus set up but their details are not extracted when calling /account/~/directory/entries

2 Answers
answered on Jan 26, 2021 at 2:12pm  

Thanks for your reply @Phong Vu. I have tried this and it didn't work. The resulting dataset is still empty.

I am running against production as well.


 0
on Jan 26, 2021 at 3:08pm   •  0 likes

What is your account main company number?

on Jan 26, 2021 at 3:15pm   •  0 likes

(02) 9053 8501

on Jan 26, 2021 at 3:28pm   •  0 likes

I can find a list of IVR menus in that company. I am not sure why using API you cannot read it though. What programming language do you call the API? Can you post some lines of code.

on Jan 26, 2021 at 3:34pm   •  0 likes

I'm using the python client library but the "Try it out!" function on the API Reference | RingCentral Developers doesn't work either.


There's nothing about the code that would raise issues.


@group_limit("medium")
def company_directory(page=1):
    queryParams = {
        "page": page,
        "perPage": 1000,
    }
    if platform is None:
        init_platform()
    with click_spinner.spinner():
        resp = platform.get(f"/restapi/v1.0/account/~/directory/entries", queryParams)

    result = resp.json_dict()
    yield result["records"]
    paging = result["paging"]
    if paging["page"] < paging["totalPages"]:
        yield from company_directory(page + 1)
on Jan 26, 2021 at 3:37pm   •  0 likes

No, that is not the endpoint. I showed you my sample code above. It is the extension endpoint with the "type=IvrMenu" filter

'/restapi/v1.0/account/~/extension'
on Jan 26, 2021 at 3:42pm   •  0 likes

I see, it's very confusing that /account/accountId/directory/entries allows you to filter IVRMenu's then

on Jan 26, 2021 at 3:20pm   •  0 likes

Can't find your account. Is this the account's name "Elgas Limited"?

on Jan 26, 2021 at 3:21pm   •  0 likes

That's the one.

answered on Jan 25, 2021 at 7:58am  

To list your company IVR menus, call the extension API with the "type" filter set to "IvrMenu". Here is the sample code in Node Js

async function list_ivr_menu(){
  try{
    var params = {
      type: ["IvrMenu"]
    }
    var resp = await platform.get('/restapi/v1.0/account/~/extension', params)
    var jsonObj = await resp.json()
    for (var record of jsonObj.records)
        console.log(JSON.stringify(record))
  }catch(e){
    console.log(e.message)
  }
}



 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us