A Plivo account is created whenever you signup on Plivo. You can retrieve your account details like email, available cash credits, name and time zone using the Account API. You can also modify your city and address to reflect in your invoices using the Account modify API.
You can retrieve an Account object by calling the Account API. An Account object contains details of your account like email address, cash credits, postal address, auto recharge settings, etc. To know more about what the Accounts API can offer, please refer to the API reference for Account.
The following snippet of code will help you get your account details:
1 2 3 4 5 import plivo client = plivo.Client() response = client.account.get()
If you would like to modify your account details, you can make changes to the name, city and the address fields.
The following snippet of code will help you modify your account details:
1 2 3 4 5 6 7 8 9 import plivo client = plivo.Client() response = client.account.update( name='Test Account', city='Bengaluru', address='Test Address', )
Subaccounts are “child accounts” linked to a parent account. If you have multiple customers to whom you wish to expose Plivo’s capabilities, you can use Subaccounts to segment, manage, and keep track of the account usages of each user independently. To know more about what the Subaccount API can offer, please refer to the API reference for Subaccount.
You can achieve the following use subaccounts:
You can create a Subaccount with a specified name and receive auth ID and auth Token dedicated to the Subaccount. You can also enforce whether the Subaccount is disabled or enabled. The Subaccount remains disabled by default.
You can use the following code snippet to create a subaccount:
1 2 3 4 5 6 7 8 import plivo client = plivo.Client() response = client.subaccounts.create( name='Test Subaccount', enabled=True, )
You can modify a Subaccount name and enable or disable a Subaccount.
You can use the following code snippet to modify a Subaccount.
1 2 3 4 5 6 7 8 import plivo client = plivo.Client() response = client.subaccounts.update( auth_id='SAYJBMZJZHMDY1NJNLMG', name='Updated Subaccount Name', )