A Plugin is a resource that contains information about a given plugin, like its name, description, and the account that owns the plugin.
While the Plugin Version Resource contains information on the actual source code for a deployed Plugin, the Plugin Resource serves as an identifier for the Plugin itself. For example, you might have a CRM plugin. You can use the Plugin Resource to describe the plugin itself, and then a series of Plugin Versions to reference the source code of your various iterations of the Plugin.
The unique string that we created to identify the Flex Plugin resource.
^FP[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The SID of the Account that created the Flex Plugin resource and owns this resource.
^AC[0-9a-fA-F]{32}$
Min length: 34
Max length: 34
The name that uniquely identifies this Flex Plugin resource.
A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long
The date and time in GMT-7 when the Flex Plugin was created specified in ISO 8601 format.
The date and time in GMT-7 when the Flex Plugin was last updated specified in ISO 8601 format.
POST https://flex-api.twilio.com/v1/PluginService/Plugins
The Flex-Metadata HTTP request header
application/x-www-form-urlencoded
A descriptive string that you create to describe the plugin resource. It can be up to 500 characters long
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 createPlugin() {11const plugin = await client.flexApi.v1.plugins.create({12uniqueName: "UniqueName",13});1415console.log(plugin.sid);16}1718createPlugin();
1{2"sid": "FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"unique_name": "UniqueName",5"friendly_name": "friendly name",6"description": "description",7"archived": false,8"date_created": "2020-01-10T20:00:00Z",9"date_updated": "2020-01-10T20:00:00Z",10"url": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"links": {12"plugin_versions": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Versions"13}14}
GET https://flex-api.twilio.com/v1/PluginService/Plugins/{Sid}
The Flex-Metadata HTTP request header
The SID of the Flex Plugin resource to fetch.
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 fetchPlugin() {11const plugin = await client.flexApi.v1.plugins("Sid").fetch();1213console.log(plugin.sid);14}1516fetchPlugin();
1{2"sid": "Sid",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"unique_name": "unique-name",5"friendly_name": "friendly name",6"description": "description",7"archived": false,8"date_created": "2020-01-10T20:00:00Z",9"date_updated": "2020-01-10T20:00:00Z",10"url": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"links": {12"plugin_versions": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Versions"13}14}
GET https://flex-api.twilio.com/v1/PluginService/Plugins
The Flex-Metadata HTTP request header
How many resources to return in each list page. The default is 50, and the maximum is 1000.
1
Maximum: 1000
The page token. This is provided by the API.
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 listPlugin() {11const plugins = await client.flexApi.v1.plugins.list({ limit: 20 });1213plugins.forEach((p) => console.log(p.sid));14}1516listPlugin();
1{2"plugins": [],3"meta": {4"page": 0,5"page_size": 50,6"first_page_url": "https://flex-api.twilio.com/v1/PluginService/Plugins?PageSize=50&Page=0",7"previous_page_url": null,8"url": "https://flex-api.twilio.com/v1/PluginService/Plugins?PageSize=50&Page=0",9"next_page_url": null,10"key": "plugins"11}12}
POST https://flex-api.twilio.com/v1/PluginService/Plugins/{Sid}
The Flex-Metadata HTTP request header
The SID of the Flex Plugin resource to update.
application/x-www-form-urlencoded
A descriptive string that you update to describe the plugin resource. It can be up to 500 characters long
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 updatePlugin() {11const plugin = await client.flexApi.v112.plugins("Sid")13.update({ friendlyName: "FriendlyName" });1415console.log(plugin.sid);16}1718updatePlugin();
1{2"sid": "Sid",3"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",4"unique_name": "unique-name",5"friendly_name": "FriendlyName",6"description": "description update",7"archived": false,8"date_created": "2020-01-10T20:00:00Z",9"date_updated": "2020-01-10T20:00:00Z",10"url": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",11"links": {12"plugin_versions": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Versions"13}14}