Latest Legacy

Update a Powerpack

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

API Endpoint

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

Arguments

nameOptionalstringMust be unique across all Powerpacks in customer’s account.
sticky_senderOptionalBoolean

Sticky sender will be enabled by default.

local_connectOptionalBoolean

Local connect will be enabled by default.

application_typeConditionalBooleanMust be specified if the application id is specified and is not 'none'.
application_idOptionalString

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.

Response

HTTP Status Code: 200

{
    "api_id": "4b2c83c4-09ff-11ea-b072-0242ac110007",
    "application_id": "20342783288007824",
    "application_type": "XML",
    "created_on": "2019-10-09T11:10:59.666461Z",
    "local_connect": true,
    "name": "test",
    "number_pool": "/v1/Account/{auth_id}/NumberPool/<number_pool_uuid>/",
    "sticky_sender": true,
    "uuid": "<powerpack_uuid>"
}

Example Request

1
2
3
4
5
6
7
8
import plivo
import json

client = plivo.RestClient("auth_id","auth_token")
powerpack = client.powerpacks.get(uuid="powerpack_uuid")
params = {}
params['name'] = "powerpack_name"
print str(powerpack.update(params))
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'rubygems'
require 'plivo'
include Plivo
include Plivo::Exceptions

api = RestClient.new("auth_id", "auth_token")
begin
  powerpack=api.powerpacks.get(uuid='your-powerpack-uuid')
  response = powerpack.update(name: 'your_powerpack_name', sticky_sender: true, local_connect: true, application_id: 'your_application_id', application_type: 'xml')
  puts response
rescue PlivoRESTError => e
  puts 'Exception: ' + e.message
end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
var plivo = require('plivo');
var client = new plivo.Client('auth_id', 'auth_token');

client.powerpacks.get("0166c910-1268-47c7-bf30-f5809ee843b9").then(
   function (powerpack) {
     return powerpack.update({
       "name": "your_powerpack_name"
     })
   })
 .then(function (result) {
   console.log(result)
 })
 .catch(function (response) {
   console.log(response);
 });
1
2
3
4
5
6
7
8
9
10
11
12
13
14
<?php
require 'vendor/autoload.php';
use Plivo\RestClient;

$client = new RestClient("auth_id", "auth_token");
$client->client->setTimeout(40);
try {
    $powerpack = $client->powerpacks->get("your-powerpack-uuid");
    $response = $powerpack->update(['name'=>'your-powerpack-name']);
    print_r($response);
}
catch (PlivoRestException $ex) {
    print_r($ex);
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package com.plivo.api;

import com.plivo.api.models.powerpack.Powerpack;
import com.plivo.api.exceptions.PlivoRestException;
import com.plivo.api.models.powerpack.PowerpackUpdateResponse;
import java.io.IOException;

public class PowerpackTest {
  public static void main(String[] args) {
    Plivo.init("auth_id", "auth_token");
    try {
      Powerpack powerpack = Powerpack.getter("powerpack_uuid").get();
      PowerpackUpdateResponse response= powerpack.updater().name("your_powerpack_name").update();
      System.out.println(response);
    }
    catch (  PlivoRestException | IOException e ) {
      e.printStackTrace();
    }
  }
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
using System;
using Plivo;
using Plivo.Exception;
using System.Collections.Generic;

namespace test_apps
{
    class Program
    {
        static void Main(string[] args)
        {
            var api = new PlivoApi("auth_id", "auth_token");
            try
            {
                var response = api.Powerpacks.Update(uuid: "powerpack_uuid",name: "your_powerpack_name", sticky_sender: false,local_connect: false);
                Console.WriteLine(response);
            }
            catch (PlivoRestException e)
            {
                Console.WriteLine("Exception: " + e.Message);
            }
        }
    }
}
1
2
3
4
curl -X POST -i --user auth_id:auth_token \
-H "Content-Type: application/json" \
-d '{"name": "your_powerpack_name","sticky_sender": "True","local_connect": "True"}' \
https://api.plivo.com/v1/Account/{auth_id}/Powerpack/{powerpack_uuid}/
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
package main

import (
	"fmt"

	plivo "github.com/plivo/plivo-go"
)

func main() {
	client, err := plivo.NewClient("auth_id", "auth_token", &plivo.ClientOptions{})
	if err != nil {
		panic(err)
	}
	powerpack, err := client.Powerpack.Get("powerpack_uuid")
	if err != nil {
		panic(err)
	}
	response, err := powerpack.Update(plivo.PowerackUpdateParams{
		Name:         "your_powerpack_name",
		StickySender: "true",
	})

	if err != nil {
		panic(err)
	}
	fmt.Printf("Response: %#v\n", response)
}