Contact Sales

All fields are required

How to List LaML Calls to CSV in Ruby | SignalWire
Developers

How to List LaML Calls to CSV in Ruby

List All the LaML Calls within a Project to CSV

Why do you need it?

This snippet might be helpful to you if you need to pull your call records from SignalWire into a more readable format or somewhere easy to store for your own records. You can use one or more of the following parameters to further filter your records and return only the specific information that you need: StartTime, EndTime, From, Status, To, and ParentCallSid. This example shows how to filter all calls by a particular date range, status, from number, and to number.

You can read more about the List Calls API here

What does it do?

This code snippet will allow you to list all the calls made (both outbound and inbound) from your SignalWire Project and export them as a CSV. You can choose the parameters you’d like to uncomment in order to filter the returned calls, or leave it with no parameters to return all of them.

Technical specifications
What variables change
  • ProjectID - Your project ID is an alphanumeric string that tells the SignalWire SDK where to find your project. You can find this in an easily copyable format by going to yourSignalWire Portal and clicking the API tab on the left hand side.

  • AuthToken - Your Auth Token is an alphanumeric string that helps to authenticate your HTTP requests to SignalWire. You can create this (if you haven’t already) or copy this in an easily copyable format by going to your SignalWire Portal and clicking the API tab. If you have not created an API token, press the blue new button. If you have, click show and copy the string.

  • SpaceURL - Your space URL is the domain of your space, i.e. example.signalwire.com. This can also be found in an easily copyable format within the API tab in your SignalWire space.

  • You will need to change the date range and status to one that fits your needs and add/remove any parameters you want to filter by.

Comments

This snippet uses the NodeJS SDK to query SignalWire and return all the call data matching the parameters you set. The data is then inserted into a CSV file.

**IMPORTANT** Remember that in JavaScript, DateTime objects start with 0 instead of 1, where 0 represents January.

Getting Started Guide

If you are looking for more information about using SignalWire, refer to our Getting Started guide.

Please feel free to reach out to us on our Community Slack or create a Support ticket if you need guidance!

Start a free trial

If you would like to test this example out, you can create a SignalWire account and space here.

Related Articles