This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Working with Accounts in Nexmo
Overview
The following operations allow you to work with accounts. Click an operation name to see details on how to use it.
For a sample proxy service that illustrates how to work with accounts, see Sample configuration.
Operation | Description |
---|---|
Retrieves the current account balance. | |
getOutboundPricing | Retrieves outbound pricing. |
Operation details
This section provides further details on the operations related to accounts.
Retrieving current account balance
The getBalance operation retrieves the current account balance.
<nexmo.getBalance/>
Sample request
Following is a sample REST/JSON request that can be handled by the getBalance
operation.
{ "apiUrl":"https://rest.nexmo.com", "apiKey":"4b6c6662", "apiSecret":"064f902c", "responseType":"xml" }
Related Nexmo documentation
https://docs.nexmo.com/index.php/developer-api/account-get-balance
Retrieving outbound pricing
The getOutboundPricing operation retrieves outbound pricing of Nexmo for a given country.
<nexmo.getOutboundPricing> <country>{$ctx:country}</country> </nexmo.getOutboundPricing>
Properties
The country code for which the outbound pricing should be retrieved.country:
Sample request
Following is a sample REST/JSON request that can be handled by the getOutboundPricing operation.
{ "apiUrl":"https://rest.nexmo.com", "apiKey":"4b6c6662", "apiSecret":"064f902c", "country":"US", "responseType":"json" }
Related Nexmo documentation
https://docs.nexmo.com/index.php/developer-api/account-pricing
Sample configuration
Following is a sample proxy service that illustrates how to connect to Nexmo with the init
operation and use the getBalance operation. The sample request for this proxy can be found in the getBalance sample request. You can use this sample as a template for using other operations in this category.
<?xml version="1.0" encoding="UTF-8"?> <proxy xmlns="http://ws.apache.org/ns/synapse" name="nexmo_getBalance" transports="https,http" statistics="disable" trace="disable" startOnLoad="true"> <target> <inSequence onError="faultHandlerSeq"> <property name="responseType" expression="json-eval($.responseType)"/> <property name="apiUrl" expression="json-eval($.apiUrl)"/> <property name="apiSecret" expression="json-eval($.apiSecret)"/> <property name="apiKey" expression="json-eval($.apiKey)"/> <nexmo.init> <responseType>{$ctx:responseType}</responseType> <apiUrl>{$ctx:apiUrl}</apiUrl> <apiSecret>{$ctx:apiSecret}</apiSecret> <apiKey>{$ctx:apiKey}</apiKey> </nexmo.init> <nexmo.getBalance/> <respond/> </inSequence> <outSequence> <send/> </outSequence> </target> <description/> </proxy>