Authentication

    All requests to Plivo API are authenticated with BasicAuth using your AUTH ID and AUTH TOKEN. You can see your Plivo AUTH ID and AUTH TOKEN at the top of the Overview page of the Plivo console.

    Example Request

    1
    2
    3
    4
    5
    6
    7
    
    import plivo
    
    proxies = {
        'http': 'https://username:password@proxyurl:proxyport',
        'https': 'https://username:password@proxyurl:proxyport'
        }
    client = plivo.RestClient('<auth_id>', '<auth_token>', proxies=proxies,timeout=5)
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    require 'rubygems'
    require 'plivo'
    
    proxy = {
    	proxy_host: "https://proxyurl",
    	proxy_port: "proxyport",
    	proxy_user: "username",
    	proxy_pass: "password"
    }
    api = RestClient.new("<auth_id>", "<auth_token>", proxy, timeout=5)
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    var plivo = require('plivo');
    let options = {
    	'timeout': 50000, //ms
    	'host': 'https://proxyurl',
    	'port': 'proxyport',
    	auth: {
    		username: 'my-user',
    		password: 'my-password'
    	}
    }
    
    var client = new plivo.Client("<auth_id>", "<auth_token>", options);
    
    1
    2
    3
    4
    5
    6
    
    <?php
    require 'vendor/autoload.php';
    use Plivo\RestClient;
    
    $client = new RestClient("<auth_id>", "<auth_token>", "<https://proxyurl>", "<proxyport>", "<username>", "<password>");
    $client->client->setTimeout(5)
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    
    package com.plivo.api.samples.application;
    
    import com.plivo.api.Plivo;
    
    class AutheExample {
      public static void main(String [] args) {
        Plivo.init();
      }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    
    using System;
    using System.Collections.Generic;
    using Plivo;
    
    namespace PlivoExamples {
      internal class Program {
        public static void Main(string[] args) {
          var api = new PlivoApi(
            "<auth_id>", "<auth_token>",
            "<https://proxyurl>", "<proxyport>", "<username>", "<password>");
          api.Client.SetTimeout(10);
        }
      }
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    package main
    
    import "github.com/plivo/plivo-go"
    
    func main()  {
      client, err := plivo.NewClient("", "", &plivo.ClientOptions{})
      if err != nil {
        panic(err)
      }
    }