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
c# api company directory.
Tags: rest api
Nov 27, 2018 at 11:57am   •   4 replies  •  0 likes
dave-southern

I'm trying to read in the company directory for our entire organization. I have the following code:


var response = rc.Restapi().Account("~").Directory();

response.Contacts();


When I run this, however, response.Contacts is not present in the returned object. I don't see anything else that looks like a listing of directory contacts.


Obviously I'm not going in the right direction. Can anybody point me down the right path?

4 Answers
answered on Nov 29, 2018 at 7:20am  
Thanks man - that get's me the data.

As an aside, is that constraint about only awaiting verb methods something that RC follows, or is that a general guideline for all webAPI's?

 0
answered on Nov 28, 2018 at 5:05pm  
Try await rc.Restapi().Account("~").Directory().Contacts().List();   or await rc.Restapi().Account("~").Directory().Contacts().Get();

You can only await on a verb method such as Get/List/Post

 0
answered on Nov 28, 2018 at 7:15am  
I tried adding the 'await' to the beginning of the call, but C# gives me an error saying DirectoryPath does not contain a definition for 'GetAwaiter'.  

For Result, I don't see that as an available option under Directory().

Do I need to update my SDK or am I missing a using or something?

 0
answered on Nov 27, 2018 at 5:11pm  
RingCentral C# API is Async.

Please try await rc.Restapi().Account("~").Directory();  or rc.Restapi().Account("~").Directory().Result;

 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