import plivo
import json

client = plivo.RestClient('<auth_id>','<auth_token>')
params = {}
number_priorities = [
    {'country_iso': 'US',
    'priority': {'priority1': 'longcode', 'priority2': 'tollfree', 'priority3': 'shortcode'},
    'service_type': 'SMS'
    }]
params["name"] = "<update_powerpack_name>"
params["number_priority"] = number_priorities

response = powerpack.update(params)
print(response)
{
   "api_id":"8b583f08-ae57-11eb-8840-0242ac110003",
   "application_id":"",
   "application_type":"",
   "created_on":"2020-09-23T09:31:25.924044Z",
   "local_connect":true,
   "name":"<powerpack_name>",
   "number_pool":"/v1/Account/<power_uuid>/NumberPool/<numberpool_id>/",
   "number_priority":[
      {
         "country_iso":"US",
         "priority":{
            "priority1":"shortcode",
            "priority2":"tollfree",
            "priority3":"longcode"
         },
         "service_type":"MMS"
      },
      {
         "country_iso":"CA",
         "priority":{
            "priority1":"shortcode",
            "priority2":"tollfree",
            "priority3":"longcode"
         },
         "service_type":"SMS"
      },
      {
         "country_iso":"US",
         "priority":{
            "priority1":"shortcode",
            "priority2":"longcode",
            "priority3":"tollfree"
         },
         "service_type":"SMS"
      },
      {
         "country_iso":"CA",
         "priority":{
            "priority1":"longcode",
            "priority2":"tollfree",
            "priority3":"shortcode"
         },
         "service_type":"MMS"
      }
   ],
   "sticky_sender":true,
   "uuid":"<powerpack_uuid>"
}

Change a Powerpack’s name, sticky_sender, local_connect, or the application connected to it.

API Endpoint

POST
https://api.plivo.com/v1/Account/{auth_id}/Powerpack/{powerpack_uuid}/

Arguments

namestringMust be unique across all Powerpacks in customer’s account.
sticky_senderBoolean

Whether Sticky Sender should be enabled by default. Sticky Sender ensures messages to a particular destination number are always sent from the same source number.

Defaults to true.

local_connectBoolean

Whether Local Connect should be enabled by default. Local Connect prioritizes local numbers matched on area code and state over other numbers in the pool.

Defaults to true.

application_typeBoolean

Conditional Must be specified if application_id is specified and is not “none”.

Allowed values: xml, phlo

application_idString

Must be set to a valid PHLO or XML App ID or “none” (String). If not specified (or set to “none”) no application to be associated with phone numbers added to this Powerpack.

import plivo
import json

client = plivo.RestClient('<auth_id>','<auth_token>')
params = {}
number_priorities = [
    {'country_iso': 'US',
    'priority': {'priority1': 'longcode', 'priority2': 'tollfree', 'priority3': 'shortcode'},
    'service_type': 'SMS'
    }]
params["name"] = "<update_powerpack_name>"
params["number_priority"] = number_priorities

response = powerpack.update(params)
print(response)
{
   "api_id":"8b583f08-ae57-11eb-8840-0242ac110003",
   "application_id":"",
   "application_type":"",
   "created_on":"2020-09-23T09:31:25.924044Z",
   "local_connect":true,
   "name":"<powerpack_name>",
   "number_pool":"/v1/Account/<power_uuid>/NumberPool/<numberpool_id>/",
   "number_priority":[
      {
         "country_iso":"US",
         "priority":{
            "priority1":"shortcode",
            "priority2":"tollfree",
            "priority3":"longcode"
         },
         "service_type":"MMS"
      },
      {
         "country_iso":"CA",
         "priority":{
            "priority1":"shortcode",
            "priority2":"tollfree",
            "priority3":"longcode"
         },
         "service_type":"SMS"
      },
      {
         "country_iso":"US",
         "priority":{
            "priority1":"shortcode",
            "priority2":"longcode",
            "priority3":"tollfree"
         },
         "service_type":"SMS"
      },
      {
         "country_iso":"CA",
         "priority":{
            "priority1":"longcode",
            "priority2":"tollfree",
            "priority3":"shortcode"
         },
         "service_type":"MMS"
      }
   ],
   "sticky_sender":true,
   "uuid":"<powerpack_uuid>"
}