Rolling Back a Release using Plugins API
Sometimes, you need to roll-back a Release. For example, maybe you pushed changes to your Flex contact center, found a bug, and now need to return to a previous stable version. The Plugins API makes it simpler and faster to do this.
Start by retrieving the list of Releases previously active on your account
_10// Download the helper library from https://www.twilio.com/docs/node/install
_10// Find your Account SID and Auth Token at twilio.com/console
_10// and set the environment variables. See http://twil.io/secure
_10const accountSid = process.env.TWILIO_ACCOUNT_SID;
_10const authToken = process.env.TWILIO_AUTH_TOKEN;
_10const client = require('twilio')(accountSid, authToken);
_10client.flexApi.v1.pluginReleases
_10 .then(pluginReleases => pluginReleases.forEach(p => console.log(p.sid)));
_20 "sid": "FKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "configuration_sid": "FJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_20 "date_created": "2020-01-10T20:00:00Z",
_20 "url": "https://flex-api.twilio.com/v1/PluginService/Releases/FKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
_20 "first_page_url": "https://flex-api.twilio.com/v1/PluginService/Releases?PageSize=50&Page=0",
_20 "previous_page_url": "https://flex-api.twilio.com/v1/PluginService/Releases?PageSize=50&Page=0",
_20 "url": "https://flex-api.twilio.com/v1/PluginService/Releases?PageSize=50&Page=0",
_20 "next_page_url": "https://flex-api.twilio.com/v1/PluginService/Releases?PageSize=50&Page=1",
From the list of Releases, choose the one that you want to roll-back to. Copy the configuration_sid of that release. You have to create a new Release with the configuration_sid copied in order to make it active on your Flex contact center.
_12// Download the helper library from https://www.twilio.com/docs/node/install
_12// Find your Account SID and Auth Token at twilio.com/console
_12// and set the environment variables. See http://twil.io/secure
_12const accountSid = process.env.TWILIO_ACCOUNT_SID;
_12const authToken = process.env.TWILIO_AUTH_TOKEN;
_12const client = require('twilio')(accountSid, authToken);
_12client.flexApi.v1.pluginReleases
_12 configurationId: 'FJ10000000000000000000000000000000'
_12 .then(plugin_release => console.log(plugin_release.sid));
_10 "sid": "FKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "account_sid": "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "configuration_sid": "FJXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
_10 "date_created": "2020-01-10T20:00:00Z",
_10 "url": "https://flex-api.twilio.com/v1/PluginService/Releases/FKXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Whew! You've successfully rolled back your Contact Center to an operational version. Go hunt down that bug, and get ready to cut a new Release with the revised Plugin Code!