List all Powerpacks

    This API can be used to fetch a list of Powerpacks.

    API Endpoint

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

    Arguments

    limit integer

    Used to display the number of results per page. The maximum number of results that can be fetched is 20. Defaults to 20.

    offset integer

    Denotes the number of value items by which the results should be offset. Defaults to 0. Read more about offset based pagination here.

    Returns

    This API returns a list of Powerpack resources associated with the Account.

    The API response also contains a meta field with the following fields:

    • limit: This the size of the page returned in the response.
    • offset: The offset for the page returned in the response.
    • total_count: The total number of records that match the specified filters.
    • next: The URL that points to the next page of results.
    • previous: The URL that points to the previous page of results.

    Response

    HTTP Status Code: 200

    {
        "api_id": "e44c159e-0a02-11ea-b072-0242ac110007",
        "meta": {
            "limit": 20,
            "next": "/api/v1/account/xxxxxxx/Powerpack?offset=20&limit=20",
            "offset": 0,
            "total_count": 53
        },
        "objects": [
            {
                "application_id": "",
                "application_type": "",
                "created_on": "2019-10-09T11:10:59.666461Z",
                "local_connect": true,
                "name": "test",
                "number_pool": "/v1/Account/xxxxxxxxx/NumberPool/<number_pool_uuid>/",
                "sticky_sender": true,
                "uuid": "<powerpack_uuid>"
            },
            {
                "application_id": "",
                "application_type": "",
                "created_on": "2019-10-09T17:03:31.837944Z",
                "local_connect": false,
                "name": "p23",
                "number_pool": "/v1/Account/xxxxxxxx/NumberPool/<number_pool_uuid>/",
                "sticky_sender": false,
                "uuid": "<powerpack_uuid>"
            },
            {
                "application_id": "",
                "application_type": "",
                "created_on": "2019-10-09T16:54:34.0117Z",
                "local_connect": false,
                "name": "p22",
                "number_pool": "/v1/Account/xxxxxxxx/NumberPool/<number_pool_uuid>/",
                "sticky_sender": false,
                "uuid": "<powerpack_uuid>"
            }
    }
    

    Example Request

    1
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    require 'rubygems'
    require 'plivo'
    include Plivo
    include Plivo::Exceptions
    
    api = RestClient.new("auth_id", "auth_token")
    begin
      response = api.powerpacks.list(offset:0, limit:20)
      puts response
    rescue PlivoRESTError => e
      puts 'Exception: ' + e.message
    end
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    var plivo = require('plivo');
    var client = new plivo.Client('auth_id', 'auth_token');
    
    client.powerpacks.list({'limit':'2', 'offset':'100'})
    .then(function (result) {
        console.log(result)})
    .catch(function (response) {
        console.log(response);
    });
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    <?php
    require 'vendor/autoload.php';
    use Plivo\RestClient;
    
    $client = new RestClient("auth_id", "auth_token");
    try {
        $response = $client->powerpacks->list();
        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
    
    package com.plivo.api;
    
    import com.plivo.api.models.base.ListResponse;
    import com.plivo.api.models.powerpack.Powerpack;
    import com.plivo.api.exceptions.PlivoRestException;
    import java.io.IOException;
    
    public class PowerpackTest {
      public static void main(String[] args) {
        Plivo.init("auth_id", "auth_token");
        try {
          ListResponse<Powerpack> powerpack = Powerpack.lister().list();
          System.out.println(powerpack);
        }
        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.List(offset:0,limit:2);
                    Console.WriteLine(response);
                }
                catch (PlivoRestException e)
                {
                    Console.WriteLine("Exception: " + e.Message);
                }
            }
        }
    }
    
    1
    2
    3
    
    curl -X GET -i --user auth_id:auth_token \
    -H "Content-Type: application/json" \
    https://api.plivo.com/v1/Account/{auth_id}/Powerpack/
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    
    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)
    	}
    	response, err := client.Powerpack.List(plivo.PowerpackListParams{Limit: 1})
    	if err != nil {
    		panic(err)
    	}
    	fmt.Printf("Response: %#v\n", response)
    }