Menu

Expand
Rate this page:

Retrieve Call Logs with C#

In this guide we’ll cover how to retrieve information about in progress and completed calls from your Twilio account.

The code snippets in this guide are written using modern C# language features and require the .NET Framework version 4.5 or higher. They also make use of the Twilio C# SDK.

The first thing we'll need to get started is our Twilio account credentials.

Retrieve your Twilio account credentials

First, you'll need to get your Twilio account credentials. They consist of your AccountSid and your Auth Token. They can be found on the home page of the console.

Retrieve Your Twilio Credentials

With our account credentials in hand, we can then retrieve our call logs using the Twilio C# library.

Retrieving call logs

You can use Twilio’s REST API to retrieve logs about the phone calls to and from your Twilio account. If you just want to check a couple logs, however, you should try looking at the voice logs in your Twilio console first.

To list all phone calls for your Twilio account, just call CallResource.Read() and iterate over it.

The Read method automatically handles paging for you, fetching new pages as you iterate through through Call objects. For more information, visit the C#/.NET Helper Library page.

        
        
        
        

        You can also filter the results. This example only returns phone calls to the phone number "+15558675309" which had a call status of "busy" but you can filter on other call properties as well.

              
              
              
              

              Finally, if you just want to retrieve information about a specific call you can get that CallSid directly.

                    
                    
                    
                    

                    Where to next?

                    We learned how to retrieve Twilio call logs using C#. Check out our tutorials to see full implementations of Twilio Voice in C# with ASP.NET.

                    David Prothero Rob Spectre Ricky Robinett Kevin Whinnery Kat King Andrew Baker Sarah Stringer
                    Rate this page:

                    Need some help?

                    We all do sometimes; code is hard. Get help now from our support team, or lean on the wisdom of the crowd browsing the Twilio tag on Stack Overflow.

                          
                          
                          

                          Thank you for your feedback!

                          We are always striving to improve our documentation quality, and your feedback is valuable to us. How could this documentation serve you better?

                          Sending your feedback...
                          🎉 Thank you for your feedback!
                          Something went wrong. Please try again.

                          Thanks for your feedback!

                          Refer us and get $10 in 3 simple steps!

                          Step 1

                          Get link

                          Get a free personal referral link here

                          Step 2

                          Give $10

                          Your user signs up and upgrade using link

                          Step 3

                          Get $10

                          1,250 free SMSes
                          OR 1,000 free voice mins
                          OR 12,000 chats
                          OR more