The Export Configuration for a resource has two uses:
You can send this via:
The webhook_method must be either GET
or POST
, and webhook_url should be the URL of the service you want to call when the file is available. For email, the email parameter should be an email address.
If true, Twilio will automatically generate every day's file when the day is over.
Stores the URL destination for the method specified in webhook_method.
Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url
The type of communication – Messages, Calls, Conferences, and Participants
The URL of this resource.
GET https://bulkexports.twilio.com/v1/Exports/{ResourceType}/Configuration
The type of communication – Messages, Calls, Conferences, and Participants
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchExportConfiguration() {11const exportConfiguration = await client.bulkexports.v112.exportConfiguration("Messages")13.fetch();1415console.log(exportConfiguration.enabled);16}1718fetchExportConfiguration();
1{2"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",3"enabled": true,4"webhook_url": "",5"webhook_method": "",6"resource_type": "Messages"7}
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function fetchExportConfiguration() {11const exportConfiguration = await client.bulkexports.v112.exportConfiguration("Calls")13.fetch();1415console.log(exportConfiguration.enabled);16}1718fetchExportConfiguration();
1{2"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",3"enabled": true,4"webhook_url": "",5"webhook_method": "",6"resource_type": "Calls"7}
POST https://bulkexports.twilio.com/v1/Exports/{ResourceType}/Configuration
The type of communication – Messages, Calls, Conferences, and Participants
application/x-www-form-urlencoded
If true, Twilio will automatically generate every day's file when the day is over.
Stores the URL destination for the method specified in webhook_method.
Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url
1// Download the helper library from https://www.twilio.com/docs/node/install2const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";34// Find your Account SID and Auth Token at twilio.com/console5// and set the environment variables. See http://twil.io/secure6const accountSid = process.env.TWILIO_ACCOUNT_SID;7const authToken = process.env.TWILIO_AUTH_TOKEN;8const client = twilio(accountSid, authToken);910async function updateExportConfiguration() {11const exportConfiguration = await client.bulkexports.v112.exportConfiguration("Messages")13.update({14webhookMethod: "GET",15webhookUrl: "https://api.your-infrastructure.com/receive-messages/",16});1718console.log(exportConfiguration.enabled);19}2021updateExportConfiguration();
1{2"url": "https://bulkexports.twilio.com/v1/Exports/Messages/Configuration",3"enabled": true,4"webhook_url": "https://api.your-infrastructure.com/receive-messages/",5"resource_type": "Messages",6"webhook_method": "GET"7}