Documentation for Developer/Administrators
HomeAccount PortalPricing
  • About this Documentation
  • Overview
    • Table of Content
    • Introduction
    • Welcome Kit
      • Add Balance
      • Buy New Phone Number
      • Voice configuration
      • SMS Configuration
        • SMS Forwarding
      • Reporting
        • CDR
        • SMS
        • FAX
  • DIDforSale Portal
    • Register a new account
    • Dashboard
    • Reporting
      • CDR
      • SMS
      • Inbound Calls
      • FAX
      • Group Usage
      • Voicemails
    • Phone Numbers
      • Phone Numbers
      • Channels
      • E911
      • Porting
      • Send FAX
      • FAX Emails
      • SMS Groups
      • Groups
      • CNAM
    • Interconnection
      • Manage IP
      • SIP Accounts
      • Testing Center
      • Phones and Devices
      • Custom Dialplan
      • Audio Files
    • Tools/Settings
      • Outbound Rates
      • API Control
      • Fraud Control
      • Postcalls
    • Account
      • Profile
      • Change Password
      • Add Balance
      • Payment History
      • Voucher
      • Invoices
      • Auto Refill
      • Charges
      • Contact Us
      • Global Settings
      • Logout
  • SIP Trunking
    • Configuration of Phone Numbers
      • Configuring SIP to IP Account
      • Configuring Custom Dial Plan to a Phone Number
      • Configure SIP to SIP Account
      • Set up Call Forwarding to a Phone Number
      • http URL Forwarding Setup
      • Webhook Setup
      • FAX
        • Receive FAX
        • Fax through SIP Account
        • Send FAX
    • Adding IP Address
    • Creating SIP Account
      • VoiceMails
    • SIP Trunk Interconnection Guide
      • 3CX
        • SIP-based Configuration
        • IP-based Configuration
      • Allworx
      • Asterisk
      • CISCO UCM
      • FreePBX
        • FreePBX PJSIP Configuration
          • IP-based
          • SIP-based
        • FreePBX ChanSIP Configuration
          • IP based
          • SIP based
      • FreeSwitch
      • FusionPBX
      • GoAutoDial
      • Grandstream Devices
        • GrandStream 6102 IPPBX
        • GrandStream 502
        • Grandstream 6104 IPPBX
      • HoduSoft PBX System
      • Microsoft Skype for Business
      • NEC Corporation
      • PBXinaFlash
      • Polycom OBi300
      • ShoreTel PBX
      • Vital PBX
      • Yealink Phones
      • ZYCOO
    • DIDForSale Softphone
    • Zoiper Softphone Application
      • Iphone App
    • Grandstream Wave Mobile Application
    • Enable Call Recording
    • Call Transcription
  • Voice and SMS APIs
    • Getting the API key and Token
    • Voice
      • Big Picture
      • Quick Start
        • Identify Caller
        • Collect Response
      • didML Reference Doc
        • Voice API Request Params
        • Voice API Response
      • didML Verbs
        • <dial>
          • <client>
          • <conference>
          • <number>
          • <queue>
          • <sip>
        • <enqueue>
        • <fax>
        • <gather>
        • <hangup>
        • <pause>
        • <play>
        • <postcall>
        • <record>
        • <recordcall>
        • <redirect>
        • <reject>
        • <say>
        • <sms>
    • SMS
      • Configure SMS
      • Send/Receive SMS via Email
      • SMS Forwarding
        • SMS forwarding to Phone Number
        • SMS forwarding to Email
        • SMS forwarding to a Webhook
      • SMS/MMS Desktop Application
      • SMS APIs
        • Activate SMS
        • Deactivate SMS API
        • Send SMS
        • SMS CDR
        • Set SMS Forwarding
      • Bulk SMS Feature
        • Creating SMS Campaign
        • Custom or Dynamic Text Sms
  • UC Editor
    • UC Editor
      • Features
      • How to configure/setup the Custom Call Flow
  • FAX via Email
    • Send & Receive FAX via Email
Powered by GitBook
On this page

Was this helpful?

  1. Voice and SMS APIs
  2. Voice

Quick Start

Now that you understand the basic fundamentals and requirements of voice API lets get you started by creating your very first API.

PreviousBig PictureNextIdentify Caller

Last updated 6 years ago

Was this helpful?

Write your first API

We will start off with basic instruction and will name our API “Hello World”.

Before you proceed choose the language that you will use to write your first API. For current example we will be using PHP. * Irrespective of the language you choose the basic steps and output will be same.

Follow the steps below:-

STEP 1:- Set Up Web URL – Make sure your web url is ready to respond to requests from DIDforSale(DFS). – The hello-world.php file should be linked directly to the url as this is the connection point for DFS. For example http://example.com/hello-world.php

STEP 2:- Configure the Phone Number – Log in to your DIDforSale account. (If you don’t have an account ) – Select an existing phone number or buy new. – Edit the phone number and link it to web url by pasting the url here and save the settings. In our current example we will link 999-888-7777 to http://example.com/hello-world.php

STEP 3:- Add Code to hello-world.php

<?php
    header("content-type: text/xml");
    echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
?>
<Response>
    <Say>Hello, Your call has successfully connected</Say>
</Response>

STEP 4:- From any phone dial 999-888-7777 – As soon as the call is initiated DFS will contact the specified weburl. (http://example.com/hello-world.php) – Once the connection is established DFS will look for instruction in hello-world.php. – As specified in current example the caller will hear “Hello Your call has successfully connected” as that’s the instruction we gave. – Call Completed.

Key word used = Say Say Reads the text and convert’s that to audio and play to the caller.

You successfully wrote and executed your Hello World API!!!

Saying "Hello" to the caller does not do any good". Let's get little more advanced.

create now