Skip to contentSkip to navigationSkip to topbar
On this page

Create a new release with new and updated Plugins


So, you've already created a Release that contains a few Plugin Versions. This guide takes you through the steps of how to roll out a new version of a plugin that is already active on your contact center or introduce a new plugin in your Flex contact center.

The recommended flow involves retrieving the currently active Release and the configuration associated with it. You can copy the list of current Plugins from the Configuration, and make your desired updates to the list. You need to then create a new Configuration, and finally, cut a new Release.

All of these steps can be accomplished via API - read on to get more detailed instructions.


Fetch The Active Release

fetch-the-active-release page anchor

Start by fetching the active Release. This will show you the current Configuration SID.

Fetch the Active ReleaseLink to code sample: Fetch the Active Release
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 fetchPluginRelease() {
11
const pluginRelease = await client.flexApi.v1
12
.pluginReleases("Active")
13
.fetch();
14
15
console.log(pluginRelease.sid);
16
}
17
18
fetchPluginRelease();

Output

1
{
2
"sid": "Active",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"configuration_sid": "FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"date_created": "2020-01-10T20:00:00Z",
6
"url": "https://flex-api.twilio.com/v1/PluginService/Releases/FKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
7
}

Read the list of Plugins active on your Contact Center

read-the-list-of-plugins-active-on-your-contact-center page anchor

Start by fetching the active Release. This will show you the current Configuration SID. You can read the plugins active on Flex, by looking up the configuration by the Configuration SID

Fetch the Configuration associated with the ReleaseLink to code sample: Fetch the Configuration associated with the Release
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 fetchPluginConfiguration() {
11
const pluginConfiguration = await client.flexApi.v1
12
.pluginConfigurations("FJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
13
.fetch();
14
15
console.log(pluginConfiguration.sid);
16
}
17
18
fetchPluginConfiguration();

Output

1
{
2
"sid": "FJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"name": "some name",
5
"description": "description",
6
"archived": false,
7
"date_created": "2020-01-10T20:00:00Z",
8
"url": "https://flex-api.twilio.com/v1/PluginService/Configurations/FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"links": {
10
"plugins": "https://flex-api.twilio.com/v1/PluginService/Configurations/FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Plugins"
11
}
12
}
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 listConfiguredPlugin() {
11
const plugins = await client.flexApi.v1
12
.pluginConfigurations("FJ10000000000000000000000000000000")
13
.plugins.list({ limit: 20 });
14
15
plugins.forEach((p) => console.log(p.accountSid));
16
}
17
18
listConfiguredPlugin();

Output

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

Create a new Configuration

create-a-new-configuration page anchor

Use the information from the old configuration to create a new Configuration. In this case, add the new Plugin Version SID you want to roll out to your Flex account, to the list of existing SIDs.

You could also update or remove an existing Plugin Version from the list.

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 createPluginConfiguration() {
11
const pluginConfiguration =
12
await client.flexApi.v1.pluginConfigurations.create({
13
description: "This is a new configuration",
14
name: "Name",
15
plugins: [
16
{
17
plugin_version: "FV00000000000000000000000000000000",
18
},
19
{
20
plugin_version: "FV10000000000000000000000000000001",
21
},
22
],
23
});
24
25
console.log(pluginConfiguration.sid);
26
}
27
28
createPluginConfiguration();

Output

1
{
2
"sid": "FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"name": "Name",
5
"description": "This is a new configuration",
6
"archived": false,
7
"date_created": "2020-01-10T20:00:00Z",
8
"url": "https://flex-api.twilio.com/v1/PluginService/Configurations/FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
9
"links": {
10
"plugins": "https://flex-api.twilio.com/v1/PluginService/Configurations/FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/Plugins"
11
}
12
}

Finally, you're ready to create a new Release.

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 createPluginRelease() {
11
const pluginRelease = await client.flexApi.v1.pluginReleases.create({
12
configurationId: "FJ10000000000000000000000000000001",
13
});
14
15
console.log(pluginRelease.sid);
16
}
17
18
createPluginRelease();

Output

1
{
2
"sid": "FKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
3
"account_sid": "ACaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
4
"configuration_sid": "FJaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
5
"date_created": "2020-01-10T20:00:00Z",
6
"url": "https://flex-api.twilio.com/v1/PluginService/Releases/FKaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
7
}

Congratulations - you've successfully rolled out new changes to your contact center, and should see your updated Plugins on the Developer Setup Page in Flex.


Learn how to roll back your Release to an older Release