PHPackages                             acrnogor/flowroute-sdk-v3-php - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. acrnogor/flowroute-sdk-v3-php

ActiveLibrary[API Development](/categories/api)

acrnogor/flowroute-sdk-v3-php
=============================

The Flowroute APIs are organized around REST. Our APIs have resource-oriented URLs, support HTTP Verbs, and respond with HTTP Status Codes. All API requests and responses, including errors, will be represented as JSON objects. You can use the Flowroute APIs to manage your Flowroute phone numbers including setting primary and failover routes for inbound calls, and sending text messages (SMS and MMS) using long-code or toll-free numbers in your account.

v0.1(1y ago)018MITPHPPHP &gt;=5.4.0

Since Oct 23Pushed 1y agoCompare

[ Source](https://github.com/acrnogor/flowroute-sdk-v3-php)[ Packagist](https://packagist.org/packages/acrnogor/flowroute-sdk-v3-php)[ Docs](https://apimatic.io)[ RSS](/packages/acrnogor-flowroute-sdk-v3-php/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (3)Used By (0)

Flowroute PHP Library v3
========================

[](#flowroute-php-library-v3)

The Flowroute PHP Library v3 provides methods for interacting with [Numbers v2](https://developer.flowroute.com/api/numbers/v2.0/) – which includes inbound voice routes, E911 addresses, and CNAM storage – and [Messages v2.1](https://developer.flowroute.com/api/messages/v2.1/) of the [Flowroute](https://www.flowroute.com) API.

**Topics**

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
    - [Configuration](#configuration)

        - [Credentials](#credentials)
        - [API Client and Controllers](#instantiate-the-api-client)
    - [Functions](#functions)

        - [Number Management](#number-management)

            - [GetAvailableAreaCodes](#getavailableareacodesclient)
            - [GetAvailableExchangeCodes](#getavailableexchangecodesclient)
            - [GetAvailableNumbers](#getavailablenumbersclient)
            - [GetNumbers](#getnumbersclient)
            - [GetNumberDetails](#getnumberdetailsclient-string-id)
        - [Route Management](#route-management)

            - [CreateInboundRoute](#createinboundrouteclient)
            - [GetInboundRoutes](#getinboundroutesclient-did-route_id)
            - [UpdatePrimaryRoute](#updateprimaryrouteclient-did-route_id)
            - [UpdateFailoverRoute](#updatefailoverrouteclient-did-route_id)
        - [Messaging](#messaging)

            - [SendSMS](#sendsmsclient-from_did)
            - [GetMessages](#getmessagesclient)
            - [GetMDRDetail](#getmdrdetailclient-id)
        - [E911 Address Management](#e911-address-management)

            - [listE911s](#liste911sclient)
            - [get\_e911\_details](#get_e911_detailsdetail_id)
            - [validate\_address](#validate_addresse911_object)
            - [create\_address](#create_addresse911_object)
            - [update\_address](#update_addressbody-detail_id)
            - [associate\_did](#associate_diddid_id-detail_id)
            - [list\_dids\_for\_address](#list_dids_for_addressdetail_id)
            - [unassociate\_did](#unassociate_diddid_id)
            - [delete\_address](#delete_addressdetail_id)
        - [CNAM Record Management](#cnam-record-management)

            - [GetCNAMs](#getcnamsclient-approval_status)
            - [getCNAMdetails](#getcnamdetailscnam_id)
            - [createCNAM](#createcnamcnam_value)
            - [associateCNAM](#associatecnamcnam_id-did)
            - [unassociateCNAM](#unassociatecnamdid)
            - [deleteCNAM](#deletecnamcnam_id)
    - [Errors](#errors)
    - [Testing](#testing)

---

Requirements
------------

[](#requirements)

- Flowroute [API credentials](https://manage.flowroute.com/accounts/preferences/api/)
- [PHP](http://php.net/downloads.php) 5.4.0 or higher
- [Composer](https://getcomposer.org/download/) 1.1.6 or higher

---

Installation
------------

[](#installation)

1. First, start a shell session and clone the SDK:

    #### via HTTPS:

    [](#via-https)

    ```
    git clone https://github.com/flowroute/flowroute-sdk-v3-php.git

    ```

    #### via SSH:

    [](#via-ssh)

    ```
    git@github.com:flowroute/flowroute-sdk-v3-php.git

    ```
2. Switch to the newly-created flowroute-sdk-v3-php directory.
3. Download [Composer](https://getcomposer.org/download/) in the same directory. PHP Library v3 comes with a **composer.json** listing the project dependencies and other metadata. Run the following:

    ```
    php composer.phar install

    ```

---

Usage
-----

[](#usage)

In Flowroute's approach to building the PHP library v3, HTTP requests are handled by an API client object accessed by functions defined in **testSDK.php** which interacts with the **Numbers**, **Routes**, and **Messages** API resources, **e911\_demo.php** which interacts with the **E911s** resource, and **cnam\_demo.php** which interacts with the **CNAMs** resouce. All demo files are located within the **test** subdirectory. First, switch to the **test** directory and open the demo file that you need to test.

###### Change directory

[](#change-directory)

```
cd test

```

###### Open test file

[](#open-test-file)

The following shows an example of a single PHP file that imports the Flowroute API client and all the required modules. The PHP Library v3 comes with three example demo files — **testSDK.php**, **e911\_demo.php**, **cnam\_demo.php** — files that you can edit and run for demonstration and testing purposes.

```
vim testSDK.php

```

Configuration
-------------

[](#configuration)

### Credentials

[](#credentials)

In **testSDK.php**, check that the required files are included at the top. Replace username with your API Access Key and password with your API Secret Key from the [Flowroute Manager](https://manage.flowroute.com/accounts/preferences/api/). Note that in our example, we are accessing your Flowroute credentials as environment variables. To learn more about setting environment variables, see [How To Read and Set Environmental and Shell Variables](https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps).

```
