Skip to contentSkip to navigationSkip to topbar
On this page

Plugin Version Resource


A Plugin Version contains all the information about a particular version of a Plugin. Some notable fields include the URL to the plugin package, the version number and what plugin is it the version of.

Providing a URL to the built package in the plugin version provides you the flexibility of hosting your package in the software of your choice.


Version Properties

version-properties page anchor
Property nameTypeRequiredDescriptionChild properties
sidSID<FV>

Optional

Not PII

The unique string that we created to identify the Flex Plugin Version resource.

Pattern: ^FV[0-9a-fA-F]{32}$Min length: 34Max length: 34

plugin_sidSID<FP>

Optional

The SID of the Flex Plugin resource this Flex Plugin Version belongs to.

Pattern: ^FP[0-9a-fA-F]{32}$Min length: 34Max length: 34

account_sidSID<AC>

Optional

The SID of the Account that created the Flex Plugin Version resource and owns this resource.

Pattern: ^AC[0-9a-fA-F]{32}$Min length: 34Max length: 34

versionstring

Optional

The unique version of this Flex Plugin Version.


plugin_urlstring<uri>

Optional

PII MTL: 30 days

The URL of where the Flex Plugin Version JavaScript bundle is hosted on.


changelogstring

Optional

A changelog that describes the changes this Flex Plugin Version brings.


privateboolean

Optional

Whether the Flex Plugin Version is validated. The default value is false.


archivedboolean

Optional

Whether the Flex Plugin Version is archived. The default value is false.


validatedboolean

Optional


date_createdstring<date-time>

Optional


urlstring<uri>

Optional

The absolute URL of the Flex Plugin Version resource.


Create a PluginVersion resource

create-a-pluginversion-resource page anchor
POST https://flex-api.twilio.com/v1/PluginService/Plugins/{PluginSid}/Versions

Headers

headers page anchor
Property nameTypeRequiredPIIDescription
Flex-Metadatastring

Optional

The Flex-Metadata HTTP request header

Property nameTypeRequiredPIIDescription
PluginSidstringrequired

The SID of the Flex Plugin the resource to belongs to.

Encoding type:application/x-www-form-urlencoded
SchemaExample
Property nameTypeRequiredDescriptionChild properties
Versionstringrequired

The Flex Plugin Version's version.


PluginUrlstring<uri>required

The URL of the Flex Plugin Version bundle


Changelogstring

Optional

The changelog of the Flex Plugin Version.


Privateboolean

Optional

Whether this Flex Plugin Version requires authorization.


CliVersionstring

Optional

The version of Flex Plugins CLI used to create this plugin


ValidateStatusstring

Optional

The validation status of the plugin, indicating whether it has been validated

Create a VersionLink to code sample: Create a Version
1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function createPluginVersion() {
11
const pluginVersion = await client.flexApi.v1
12
.plugins("PluginSid")
13
.pluginVersions.create({
14
pluginUrl: "https://www.example.com",
15
version: "Version",
16
});
17
18
console.log(pluginVersion.sid);
19
}
20
21
createPluginVersion();

Output

1
{
2
"sid": "FVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"plugin_sid": "PluginSid",
5
"version": "Version",
6
"plugin_url": "https://www.example.com",
7
"changelog": "the changelog",
8
"private": true,
9
"archived": false,
10
"validated": false,
11
"date_created": "2020-01-10T20:00:00Z",
12
"url": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Versions/FVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
13
}

Fetch a PluginVersion resource

fetch-a-pluginversion-resource page anchor
GET https://flex-api.twilio.com/v1/PluginService/Plugins/{PluginSid}/Versions/{Sid}

Property nameTypeRequiredPIIDescription
Flex-Metadatastring

Optional

The Flex-Metadata HTTP request header

Property nameTypeRequiredPIIDescription
PluginSidstringrequired

The SID of the Flex Plugin the resource to belongs to.


Sidstringrequired

The SID of the Flex Plugin Version resource to fetch.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function fetchPluginVersion() {
11
const pluginVersion = await client.flexApi.v1
12
.plugins("PluginSid")
13
.pluginVersions("Sid")
14
.fetch();
15
16
console.log(pluginVersion.sid);
17
}
18
19
fetchPluginVersion();

Output

1
{
2
"sid": "Sid",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"plugin_sid": "PluginSid",
5
"version": "1.0.0",
6
"plugin_url": "https://sample.twil.io/plugin.js",
7
"changelog": "the changelog",
8
"private": false,
9
"archived": false,
10
"validated": false,
11
"date_created": "2020-01-10T20:00:00Z",
12
"url": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Versions/FVaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
13
}

Read multiple PluginVersion resources

read-multiple-pluginversion-resources page anchor
GET https://flex-api.twilio.com/v1/PluginService/Plugins/{PluginSid}/Versions

Property nameTypeRequiredPIIDescription
Flex-Metadatastring

Optional

The Flex-Metadata HTTP request header

Property nameTypeRequiredPIIDescription
PluginSidstringrequired

The SID of the Flex Plugin the resource to belongs to.

Property nameTypeRequiredPIIDescription
PageSizeinteger

Optional

How many resources to return in each list page. The default is 50, and the maximum is 1000.

Minimum: 1Maximum: 1000

Pageinteger

Optional

The page index. This value is simply for client state.

Minimum: 0

PageTokenstring

Optional

The page token. This is provided by the API.

1
// Download the helper library from https://www.twilio.com/docs/node/install
2
const twilio = require("twilio"); // Or, for ESM: import twilio from "twilio";
3
4
// Find your Account SID and Auth Token at twilio.com/console
5
// and set the environment variables. See http://twil.io/secure
6
const accountSid = process.env.TWILIO_ACCOUNT_SID;
7
const authToken = process.env.TWILIO_AUTH_TOKEN;
8
const client = twilio(accountSid, authToken);
9
10
async function listPluginVersion() {
11
const pluginVersions = await client.flexApi.v1
12
.plugins("PluginSid")
13
.pluginVersions.list({ limit: 20 });
14
15
pluginVersions.forEach((p) => console.log(p.sid));
16
}
17
18
listPluginVersion();

Output

1
{
2
"plugin_versions": [],
3
"meta": {
4
"page": 0,
5
"page_size": 50,
6
"first_page_url": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Versions?PageSize=50&Page=0",
7
"previous_page_url": null,
8
"url": "https://flex-api.twilio.com/v1/PluginService/Plugins/FPaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Versions?PageSize=50&Page=0",
9
"next_page_url": null,
10
"key": "plugin_versions"
11
}
12
}

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.