Skip to content

Latest commit

 

History

History
232 lines (166 loc) · 8.15 KB

PhoneNumberLookupApi.md

File metadata and controls

232 lines (166 loc) · 8.15 KB

Bandwidth\PhoneNumberLookupApi

All URIs are relative to http://localhost, except if the operation defines another base path.

Method HTTP request Description
createAsyncBulkLookup() POST /accounts/{accountId}/phoneNumberLookup/bulk Create Asynchronous Bulk Number Lookup
createSyncLookup() POST /accounts/{accountId}/phoneNumberLookup Create Synchronous Number Lookup
getAsyncBulkLookup() GET /accounts/{accountId}/phoneNumberLookup/bulk/{requestId} Get Asynchronous Bulk Number Lookup

createAsyncBulkLookup()

createAsyncBulkLookup($account_id, $async_lookup_request): \Bandwidth\Model\CreateAsyncBulkLookupResponse

URI(s):

Creates an asynchronous bulk phone number lookup request. Maximum of 15,000 telephone numbers per request. Use the Get Asynchronous Bulk Number Lookup endpoint to check the status of the request and view the results.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure HTTP basic authorization: Basic
$config = Bandwidth\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\PhoneNumberLookupApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string
$async_lookup_request = new \Bandwidth\Model\AsyncLookupRequest(); // \Bandwidth\Model\AsyncLookupRequest | Asynchronous bulk phone number lookup request.

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->createAsyncBulkLookup($account_id, $async_lookup_request, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PhoneNumberLookupApi->createAsyncBulkLookup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string
async_lookup_request \Bandwidth\Model\AsyncLookupRequest Asynchronous bulk phone number lookup request.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\Bandwidth\Model\CreateAsyncBulkLookupResponse

Authorization

Basic, OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

createSyncLookup()

createSyncLookup($account_id, $sync_lookup_request): \Bandwidth\Model\CreateSyncLookupResponse

URI(s):

Creates a synchronous phone number lookup request. Maximum of 100 telephone numbers per request.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure HTTP basic authorization: Basic
$config = Bandwidth\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\PhoneNumberLookupApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string
$sync_lookup_request = new \Bandwidth\Model\SyncLookupRequest(); // \Bandwidth\Model\SyncLookupRequest | Synchronous phone number lookup request.

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->createSyncLookup($account_id, $sync_lookup_request, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PhoneNumberLookupApi->createSyncLookup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string
sync_lookup_request \Bandwidth\Model\SyncLookupRequest Synchronous phone number lookup request.
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\Bandwidth\Model\CreateSyncLookupResponse

Authorization

Basic, OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

getAsyncBulkLookup()

getAsyncBulkLookup($account_id, $request_id): \Bandwidth\Model\GetAsyncBulkLookupResponse

URI(s):

Get an existing Asynchronous Bulk Number Lookup. Use this endpoint to check the status of the request and view the results.

Example

<?php
require_once(__DIR__ . '/vendor/autoload.php');


// Configure HTTP basic authorization: Basic
$config = Bandwidth\Configuration::getDefaultConfiguration()
              ->setUsername('YOUR_USERNAME')
              ->setPassword('YOUR_PASSWORD');

// Configure OAuth2 access token for authorization: OAuth2
$config = Bandwidth\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new Bandwidth\Api\PhoneNumberLookupApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$account_id = 9900000; // string
$request_id = 004223a0-8b17-41b1-bf81-20732adf5590; // string

$hostIndex = 0;
$variables = [
];

try {
    $result = $apiInstance->getAsyncBulkLookup($account_id, $request_id, $hostIndex, $variables);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling PhoneNumberLookupApi->getAsyncBulkLookup: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
account_id string
request_id string
hostIndex null int Host index. Defaults to null. If null, then the library will use $this->hostIndex instead
variables array Associative array of variables to pass to the host. Defaults to empty array. [optional]

Return type

\Bandwidth\Model\GetAsyncBulkLookupResponse

Authorization

Basic, OAuth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]