## Example for Subaccount Get#require'rubygems'require'plivo'includePlivoincludePlivo::Exceptionsapi=RestClient.new("<auth_id>","<auth_token>")beginresponse=api.subaccounts.get('SA2025RK4E639VJFZAMM')putsresponserescuePlivoRESTError=>eputs'Exception: '+e.messageend
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Example for Subaccount getvarplivo=require('plivo');(functionmain(){'use strict';// If auth id and auth token are not specified, Plivo will fetch them from the environment variables.varclient=newplivo.Client("<auth_id>","<auth_token>");client.subaccounts.get("SA2025RK4E639VJFZAMM",// subauth id).then(function(response){console.log(response);},function(err){console.error(err);});})();
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<?php/**
* Example for Subaccount get
*/require'vendor/autoload.php';usePlivo\RestClient;usePlivo\Exceptions\PlivoRestException;$client=newRestClient("<auth_id>","<auth_token>");try{$response=$client->subaccounts->get('SA2025RK4E639VJFZAMM');print_r($response);}catch(PlivoRestException$ex){print_r($ex);}
packagecom.plivo.api.samples.subaccount;importjava.io.IOException;importcom.plivo.api.Plivo;importcom.plivo.api.exceptions.PlivoRestException;importcom.plivo.api.models.account.Subaccount;importcom.plivo.api.models.account.Subaccount;/**
* Example for Subaccount get
*/classSubaccountGet{publicstaticvoidmain(String[]args){Plivo.init("<auth_id>","<auth_token>");try{Subaccountresponse=Subaccount.getter("SA2025RK4E639VJFZAMM").get();System.out.println(response);}catch(PlivoRestException|IOExceptione){e.printStackTrace();}}}
/**
* Example for Subaccount Get
*/usingSystem;usingSystem.Collections.Generic;usingPlivo;usingPlivo.Exception;namespacePlivoExamples{internalclassProgram{publicstaticvoidMain(string[]args){varapi=newPlivoApi("<auth_id>","<auth_token>");try{varresponse=api.Subaccount.Get(id:"SA2025RK4E639VJFZAMM");Console.WriteLine(response);}catch(PlivoRestExceptione){Console.WriteLine("Exception: "+e.Message);}}}}
// Example for Subaccount getpackagemainimport("fmt""github.com/plivo/plivo-go/v7")funcmain(){client,err:=plivo.NewClient("<auth_id>","<auth_token>",&plivo.ClientOptions{})iferr!=nil{fmt.Print("Error",err.Error())return}response,err:=client.Subaccounts.Get("SA2025RK4E639VJFZAMM",)iferr!=nil{fmt.Print("Error",err.Error())return}fmt.Printf("Response: %#v\n",response)}
Example Request
1
2
3
4
5
6
7
8
9
10
11
12
13
importplivoauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=plivo.RestAPI(auth_id,auth_token)params={# Subacccount Auth ID of which to retrieve details
'subauth_id':'XXXXXXXXXXXXXXXXXXXX'}response=p.get_subaccount(params)printstr(response)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
require'rubygems'require'plivo'includePlivoauth_id="Your AUTH_ID"auth_token="Your AUTH_TOKEN"p=RestAPI.new(auth_id,auth_token)params={# Subacccount Auth ID of which to retrieve details'subauth_id'=>'XXXXXXXXXXXXXXXXXXXX'}response=p.get_subaccount(params)printresponse
1
2
3
4
5
6
7
8
9
10
11
12
13
varplivo=require('plivo');varp=plivo.RestAPI({authId:'Your AUTH_ID',authToken:'Your AUTH_TOKEN'});varparams={// Subacccount Auth ID of which to retrieve details'subauth_id':'XXXXXXXXXXXXXXXXXXXX'};varresponse=p.get_subaccount(params);console.log(response);
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?phprequire'vendor/autoload.php';usePlivo\RestAPI;$auth_id="Your AUTH_ID";$auth_token="Your AUTH_TOKEN";$p=newRestAPI($auth_id,$auth_token);$params=array(// Subacccount Auth ID of which to retrieve details'subauth_id'=>'XXXXXXXXXXXXXXXXXXXX');$response=$p->get_subaccount($params);print_r($response['response']);?>
packageplivoexample;importjava.util.LinkedHashMap;importcom.plivo.helper.api.client.*;importcom.plivo.helper.api.response.account.SubAccount;importcom.plivo.helper.exception.PlivoException;publicclassApp{publicstaticvoidmain(String[]args)throwsIllegalAccessException{Stringauth_id="Your AUTH_ID";Stringauth_token="Your AUTH_TOKEN";RestAPIapi=newRestAPI(auth_id,auth_token,"v1");LinkedHashMap<String,String>params=newLinkedHashMap<String,String>();// Subacccount Auth ID of which to retrieve detailsparams.put("subauth_id","XXXXXXXXXXXXXXXXXXXX");try{SubAccountresp=api.getSubaccount(params);System.out.println(resp);}catch(PlivoExceptione){System.out.println(e.getLocalizedMessage());}}}
usingSystem;usingSystem.Collections.Generic;usingRestSharp;usingPlivo.API;namespaceapps{classProgram{staticvoidMain(string[]args){RestAPIplivo=newRestAPI("Your AUTH_ID","Your AUTH_TOKEN");IRestResponse<SubAccount>res=plivo.get_subaccount(newDictionary<string,string>(){// Subacccount Auth ID of which to retrieve details{"subauth_id","XXXXXXXXXXXXXXXXXXXX"}});//Prints the responseConsole.Write(res.Content);}}}
// Example for Subaccount getpackagemainimport("fmt""github.com/plivo/plivo-go/v7")funcmain(){client,err:=plivo.NewClient("<auth_id>","<auth_token>",&plivo.ClientOptions{})iferr!=nil{fmt.Print("Error",err.Error())return}response,err:=client.Subaccounts.Get("SA2025RK4E639VJFZAMM",)iferr!=nil{fmt.Print("Error",err.Error())return}fmt.Printf("Response: %#v\n",response)}
Rate this page
🥳 Thank you! It means a lot to us!
×
Help Us Improve
Thank you so much for rating the page, we would like to get your input
for further improvements!