Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This API client is an experiment that demonstrates the flexibility of UnifiedAPI. The client extends the existing Google's Client Library for PHP and enables you to write Apps easier. The extension handles all the steps necessary for an App to register and communicate with VoipNow:

  • dynamic Dynamic App registration: registration of an App is a click away. Just configure the App and see how it automatically registers using your VoipNow credentials.
  • App authorization: the OAuth 2 flow has never been so easy to master. You have to fill in your credentials and that's it.
  • create Create a valid, authorized UnifiedAPI REST request: you ask, the client delivers. You don't need to concern yourself with protocol implementation anymore.

...

  1. Installation. Here you download Google's PHP Client Library and the UnifiedAPI Client. You also make a one line change to the Google Client.
  2. Your App in 15 Minutes. Here you learn how to harness the power behind our software in a quick, down and dirty tutorial.
  3. The Call Widget. We also wrote a widget to show you how to integrate UnifiedAPI into your existing website. 
  4. More Examples. If you want to see all of the operations on all of the resources UnifiedAPI has to offer, you must try this all-in-one demo.

...

In order to use the UnifiedAPI Client, you need a webserver with PHP 5.3 or higher installed.  You You also require the mcrypt extension for the encrypted storage class.

...

Download and extract Google's client library for PHP (version 0.6). Download the archive containing the code from here and extract and extract it to a path in your project or web root. (This path will be known as GOOGLE_CLIENT_PATH.  ee.g. /home/user/lib/google-api-php-client).

...

Download and extract the UnifiedAPI Client. Download the attached archive from here and extract it to it to a path in your project or web root.   (This path will be known as as UNIFIEDAPI_CLIENT_PATH. e.g. /home/user/lib/uapiclient).

...

STEP 2: Change the name of the copied config.php.default file to config.php.

STEP 3: Edit config Edit config.php and php and fill in the required values. An example stripped of comments is available below.

...

If the config file has an empty client id and client secret, then a registration link will be displayed when you first access the app. Don't worry, it's normal. When you press the link, you'll be redirected to your VoipNow server's App registration endpoint. In the registration screen you must fill in your VoipNow credentials.  For For more details, see see App Registration.

App authorization

After registration or if client credentials were provided in the config file, you will be redirected to the authorization endpoint where the App will ask permission to access your data. You will have to fill in you VoipNow credentials again. After this, the access token has been generated and stored with encryption on the client. For more details, see see App Authorization.

Make the call

Now you are able to access your SimpleCall app at httpsat https://<AppServerHost>/<PathToYourAppFolder>/index.php A very simple form should appear. You must enter the extension you want to call and.... presto, you're making a phone call the UnifiedAPI way.

...

An example widget was written in jQuery and PHP to demonstrate how easy it is to write the server side code using the UnifiedAPI Client. The widget can also be used as a starting point to writing other such software. The client code is written in jQuery and CSS, while all HTML is created dynamicallycreated dynamically. These types of widgets are easy to integrate into your website because of their standalone nature. 

Widget configuration

Please follow the next steps:

STEP 1:  Copy the contents of <UNIFIEDAPI_CLIENT_PATH>/examples/callWidget/ to a folder in your webroot.

STEP 2:  Change the name of the copied config.php.default file to config.php.

STEP 3: Edit config Edit config.php and php and fill in the required values. An example stripped of comments is available below.

...

The widget uses an install script to acquire client credentials and to request an access token for authorizing subsequent request. To install the widget, access the install.php script through your browser (it should be located in the widget folder). A link will be displayed and, upon clicking it, you will be redirected to the registration endpoint of the server and, after that, to the authorization endpoint. For more details, see see App Registration and  and App Authorization.

Add the widget to your website

...

An example App was written to demonstrate all of UnifiedApi's operations. 

App configuration

Please follow the next steps:

STEP 1:  Copy the contents of <UNIFIEDAPI_CLIENT_PATH>/examples/uapi/ to a folder in your webroot.

STEP 2:  Change the name of the copied config.php.default file to config.php.

STEP 3: Edit config Edit config.php and php and fill in the required values. An example stripped of comments is available below.

...

If the config file has an empty client id and client secret, then a registration link will be displayed when you first access the app. Don't worry, it's normal. When you press the link, you'll be redirected to your VoipNow server's App registration endpoint. In the registration screen you must fill in your VoipNow credentials.  For For more details, see see App Registration.

App authorization

After registration or if client credentials were provided in the config file, you will be redirected to the authorization endpoint where the App will ask permission to access your data. You will have to fill in you VoipNow credentials again. After this, the access token has been generated and stored with encryption on the client. For more details, see see App Authorization.

Make the call

Now you are able to access the examples at httpsat https://<AppServerHost>/<PathToYourAppFolder>/index.php A menu is available on the left side of the screen. It consists of all the resources available in UnifiedAPI and all of the operations you can perform on those resources.

...

Expand
titleSee List Example Screen



4psarelated
NameRelated Topics

UnifiedAPI Examples

CallMeButton

Click2Conference

Click2Fax

FacebookCallMe



Except where otherwise noted, content in this space is licensed under a Creative Commons Attribution 4.0 International.