Rate this page:

Thanks for rating this page!

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

Retrieve Call Logs with Java

In this guide we'll learn how to retrieve information about in progress and completed calls from your Twilio account using Java.

We’ll use Twilio’s Java SDK in these examples to interact with the Twilio REST APIs Calls endpoint.

The first thing we'll need to get started is your 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

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 "client.getAccount().getCalls()" and iterate over it.


        Please note that the list returned to you when fetching all calls includes paging information. If you plan to request more records than will fit on a single page, you can use the provided nextpageuri rather than incrementing through pages by page number.

        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 just learned how to retrieve Twilio call logs using Java. Check out our tutorials to see full implementations of Twilio Voice in Java.

                    David Prothero Agustin Camino Rob Spectre Ricky Robinett Kevin Whinnery Kat King Andrew Baker
                    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.