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 Numbers in Nexmo

The searchInboundNumbers operation retrieves available inbound numbers for a given country.

searchInboundNumbers
<nexmo.searchInboundNumbers>
    <country>{$ctx:country}</country>
    <pattern>{$ctx:pattern}</pattern>
    <searchPattern>{$ctx:searchPattern}</searchPattern>
    <index>{$ctx:index}</index>
    <features>{$ctx:features}</features>
	<size>{$ctx:size}</size>
</nexmo.searchInboundNumbers>
Properties
  • country: The country code to search.
  • pattern: The pattern for searching with the search strategy.
  • searchPattern: The strategy for matching pattern.
  • index: The page number to retrieve.
  • features: The comma separated available features to search.
  • size: The size of a response page.
Sample request

Following is a sample REST/JSON request that can be handled by the searchInboundNumbers operation.

Sample Request for searchInboundNumbers
{
	"apiUrl": "https://rest.nexmo.com",
	"apiKey": "4e218344",
	"apiSecret": "c3f7d5f1",
	"responseType": "json",
	"country": "US",
	"pattern": "55597",
	"searchPattern": "2",
	"features": "",
	"size": "2",
	"index": "2"
}
Related Nexmo documentation
https://docs.nexmo.com/index.php/sms-api/handle-inbound-message

Sample configuration

Following is a sample proxy service that illustrates how to connect to Shopify with the init operation and use the searchInboundNumbers operation. The sample request for this proxy can be found in the searchInboundNumbers sample request.

Sample Proxy
<?xml version="1.0" encoding="UTF-8"?>
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="nexmo_searchInboundNumbers"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence onError="faultHandlerSeq">
         <property name="apiUrl" expression="json-eval($.apiUrl)"/>
         <property name="apiKey" expression="json-eval($.apiKey)"/>
         <property name="apiSecret" expression="json-eval($.apiSecret)"/>
         <property name="responseType" expression="json-eval($.responseType)"/>
         <property name="country" expression="json-eval($.country)"/>
         <property name="pattern" expression="json-eval($.pattern)"/>
         <property name="searchPattern" expression="json-eval($.searchPattern)"/>
         <property name="features" expression="json-eval($.features)"/>
         <property name="index" expression="json-eval($.index)"/>
         <property name="size" expression="json-eval($.size)"/>
         <nexmo.init>
            <apiUrl>{$ctx:apiUrl}</apiUrl>
            <apiKey>{$ctx:apiKey}</apiKey>
            <apiSecret>{$ctx:apiSecret}</apiSecret>
            <responseType>{$ctx:responseType}</responseType>
         </nexmo.init>
         <nexmo.searchInboundNumbers>
            <country>{$ctx:country}</country>
            <pattern>{$ctx:pattern}</pattern>
            <searchPattern>{$ctx:searchPattern}</searchPattern>
            <index>{$ctx:index}</index>
            <features>{$ctx:features}</features>
            <size>{$ctx:size}</size>
         </nexmo.searchInboundNumbers>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>