Menu

Expand
Rate this page:

Day Resource

The Day resource allows you to download the export file containing a single day's data for your account and the requested data type.

Messages Export file format

Day files are stored and returned as compressed (gzip) JSON files with one record per line. Records are similar to the Message resource. The differences are:

  • price_units will not be present
  • api_version will not be present
  • error message will not be present (but error_code is)
  • uri and subresource_uris will not be present.
  • timestamps like date created, date updated and date sent are in UTC and ISO 8601 format.

Calls Export file format

Day files are stored and returned as compressed (gzip) JSON files with one record per line. Records are similar to the Calls resource. The differences are:

  • timestamps are in UTC and ISO 8601 format.
  • Price data may not be present on all messages in BulkExport
  • uri and subresource_uris will not be present.

Conferences Export file format

Day files are stored and returned as compressed (gzip) JSON files with one record per line. Records are similar to the Conferences resource. The differences are:

  • timestamps are in UTC and ISO 8601 format.
  • api_version will not be present
  • uri and subresource_uris will not be present.

Participants BulkExport file format

Day files are stored and returned as compressed (gzip) JSON files with one record per line. Records are similar to the Participants resource. The differences are:

  • timestamps are in UTC and ISO 8601 format.
  • uri will not be present
  • label will not be present

Day properties

Resource Properties in REST API format
day
string Not PII

The ISO 8601 format date of the resources in the file, for a UTC day

size
integer Not PII

The size of the day's data file in bytes

create_date
string Not PII

The ISO 8601 format date when resources is created

friendly_name
string Not PII

The friendly name specified when creating the job

resource_type
string Not PII

The type of communication – Messages, Calls, Conferences, and Participants

Instance Properties in REST API format
redirect_to
url Not PII

Fetch a single day file

get
https://bulkexports.twilio.com/v1/Exports/{ResourceType}/Days/{Day}
Parameters
Parameters in REST API format
resource_type
Path
get string Not PII

The type of communication – Messages, Calls, Conferences, and Participants

day
Path
get string Not PII

The ISO 8601 format date of the resources in the file, for a UTC day

Example 1
Loading Code Sample...
        
        
        This will get a redirection to the day's file, once you know what days are available from the list of exported days.

        Fetch a single file for an exported day

        This will get a redirection to the day's file, once you know what days are available from the list of exported days.

        Once you have the redirection, you can fetch the file. The redirection is of the format:

        https://documentation-example-twilio-bucket/daily/day%3D2020-02-02/type%3DMessages/account%3DACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/created_time%3D20200202000014/part-0XXXXXXXXXX0.json.gz?X-Amz-Security-Token=IQoXXXXXXXXH1GQ%3D%3D&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Date=20200202T012341Z&X-Amz-SignedHeaders=host&X-Amz-Expires=240&X-Amz-Credential=AXXXXXXXXXXX22%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Signature=bXXXXXXXXX9

        This link is a one-time use signed S3 link to the file. You can request these links multiple times from the API above, but each link can only be used once.

        The file in compressed using gzip. You can use a command line tool to gunzip the file, or utilities in your language like Java's GZIPInputStream or GZipStream in C#.

        Inside the file, messages are contained, with JSON equivalent to the Message Resource. These are of the format

        {
        "date_updated": "2020-01-013T03:57:34Z",
        "date_sent": "2020-01-01T03:57:33Z",
        "date_created": "2020-01-01T03:57:32Z",
        "body": "Sent from your Twilio trial account - woot woot!!!!",
        "num_segments": 1,
        "sid": "SM32743c2e9c251806c2317dee566f6d7b",
        "num_media": 0,
        "messaging_service_sid": "MG1ef70550624e8b354860a98d787ee1f1",
        "account_sid": "ACa674802ceae35ad19498be749e085991",
        "from": "+14155551212",
        "error_code": null,
        "to": "+14155552389",
        "status": "delivered",
        "direction": "outbound-api"
        }

        This will be repeated per message for that day.

        Read multiple Day resources

        get
        https://bulkexports.twilio.com/v1/Exports/{ResourceType}/Days

        {ResourceType} is the type of Twilio resource, one of Calls or Messages. The Developer Preview release of Day supports exporting Messages only.

        Parameters
        Parameters in REST API format
        resource_type
        Path
        get string Not PII

        The type of communication – Messages, Calls, Conferences, and Participants

        Example 1
        Loading Code Sample...
              
              
              This will get the list of the exported days. There will be one day json block per day of exported data.

              Fetch a list of exported days

              This will get the list of the exported days. There will be one day json block per day of exported data.
              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 by visiting Twilio's Stack Overflow Collective or browsing the Twilio tag on Stack Overflow.

              Loading Code Sample...
                    
                    
                    

                    Thank you for your feedback!

                    Please select the reason(s) for your feedback. The additional information you provide helps us improve our documentation:

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

                    Thanks for your feedback!

                    thanks-feedback-gif