メニュー

Expand
ページを評価:

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.

Export File Format

Day files are stored and returned as compressed (gzip) JSON files with one record per line. The properties of the JSON objects will match those of the corresponding resource in the Twilio REST API with the following exceptions:

  • 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.

Day properties

Resource Properties in REST API format
day
文字列 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
文字列 Not PII

The ISO 8601 format date when resources is created

friendly_name
文字列 Not PII

The friendly name specified when creating the job

resource_type
文字列 Not PII

The type of communication – Messages, Calls

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 in REST API format
resource_type
Path
GET 文字列 Not PII

The type of communication – Messages, Calls

day
Path
GET 文字列 Not PII

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

例 1
        
        
        
        
        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://com-twilio-exports.s3.amazonaws.com/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 in REST API format
        resource_type
        Path
        GET 文字列 Not PII

        The type of communication – Messages, Calls

        例 1
              
              
              
              
              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.
              ページを評価:

              ヘルプが必要ですか?

              誰しもが一度は考える「コーディングって難しい」。そんな時は、お問い合わせフォームから質問してください。 または、Stack Overflow でTwilioタグのついた情報から欲しいものを探してみましょう。

                    
                    
                    

                    フィードバックくださりありがとうございます!

                    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!

                    ステップ1

                    Get link

                    Get a free personal referral link here

                    ステップ2:

                    Give $10

                    Your user signs up and upgrade using link

                    ステップ3

                    Get $10

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