Docs

Server-Side SDK

GET STARTED with examples

DOWNLOAD SERVER-SIDE SDK

Overview

Server-side SDK make it easy for you to use Apifonica's REST APIs, create XML, and do other common server-side programming tasks.

These helper libraries are available in a variety of popular server-side programming languages.

Features for server-side SDK:

  • Server management and its interaction with Mobile SDK apps and Apifonica server;
  • Monitoring rented phone numbers;
  • Monitoring Incomming/OutGoing Calls via XML scenarios;
  • Synchronize the rented numbers stored on your server with rented numbers stored in your Apifonica account.

Setting up Server-Side:

  • Make sure you have the following packages installed: git, node.js, mysql.
  • Copy SDK archive package directly to your server where SDK needs to be deployed.
  • Using console mode open the project folder, write command **npm install** and wait until all modules are installed.
  • Register on Apifonica website, copy your ‘AccountSID ‘ and ‘AuthToken’ from api access section and enter these values to the ‘config.js’ file section:
    • sid: “accxx-xxxx-xxxx”
    • token: “autxx-xxx-xxxx”
  • Set VAT value for your newly registered account via Apifonica website.
  • Create application with ‘ApplicationSID’ code via Apifonica website.
  • Set domain name in ‘config.js’ file for REST API queries: domain: ‘api.apifonica.com’
  • Set up Mysql database. Create table. Ready to use SQL code can be found in ‘my_schema.sql’ file.
  • Add at least one user with his account to the ‘users’ table.
  • Open ‘config.js’ file and insert your MySQL settings.
  • Set insert ‘AccountSID’ and ‘AuthToken’ codes in ‘config.js’ file, taken from your account.
  • From the root of the project create a self-signed sertificate.
  • Start your server using “”node app.js** command.

Server-Side management

You can open html page:

with your server management and its interaction with Mobile SDK apps and Apifonica server.

The page displays the current values of the user's identifier (AccountSID / AuthToken), depending on user’s provided details in your Apifonica account: Sid: 'AccountSID‘ Token: 'AuthToken‘

The page also displays the current list of available accounts for iOS/Android apps.

List of available commands

  • Create a new account to connect iOS/Android apps with Mobile SDK packages installed to rent a phone number or to use already rented phone numbers to make voice calls. User enters his desired username/password, sets the "Application SID" code, for which a new account will be created to connect with iOS/Android applications and clicks "Register" button. As a result, the list of rented phone numbers will be updated under the "Register" button.
  • Synchronize rented numbers stored on your server with rented numbers stored in your account on Apifonica. This command is executed by pressing the "Sync" button. It is recommended to perform this command immediately after the first launch of the your server. As a result, the list of rented numbers will be displayed under the "Sync" button. Note that there is no warning when synchronization is finished.