About API's -
REST APIs
Using the Knowlus APIs you can make outgoing calls to phones and SIP-enabled
endpoints. Since the API is based on REST principles, it’s very easy to write
and test applications. You can use your browser to access URLs, and pretty much
any HTTP client in any programming language to interact with the API.
HTTP GET and POST
You can configure Knowlus to make its initial HTML
requests to your application via HTTP GET or POST methods.
POST
When Knowlus performs an HTTP POST to a web server,
metadata associated with the call (phone number, etc.) is passed as the body of
the POST just as if the parameters were submitted as part of a form on a
webpage.
Tip : One important point to note is that you cannot
cache POST requests. To cache HTML requests, make use of the HTTP GET method.
Note: In the POST method of all the APIs, Knowlus does
not use username and password. Instead you will need an encryption and a
decryption key. You can generate these anytime from within the Register Keys
tab in the API section of the web interface. The encryption and decryption keys
will be sent to your registered email id.
GET
When Knowlus performs an HTTP GET to a web server, metadata associated with the call (phone number, etc.) is passed as URL query string parameters as if the parameters were submitted as part of a form on a webpage. Knowlus locally caches static HTML documents and media files.
1. Points to remember for exception handling during API
integration:
- All special
characters are rejected in GET form api since they are converted into unicode
at backend. It is an exception at the system.
- An API key provides access to the SR account details for any SMS or CRM
integration without knowing the username or paasword.
- Any API cannot use the already defined variables of our system.For example if
any api has 'to' or 'destination' then an exception occurs and the value of
destination is changed which hampers the functioning of the API
- If the API consists of any parameters or declarations after ? Then it will be
of type GET
- All URL types API are of the form POST
- GET API can be tested by hitting on the browser.
- As for post it can only be tested by certain tools for example postman etc
which requires technical knowledge and hence it is advisable to ask the
customer to check his API
- Our API does not support%2b(+) unicode
- API wrapper needs to be created for $caller_id to fetch the callers number
and cut into it 10 digit numbers.
- POST form API gathers all the variables from our system and then sees it in
the customers system
- GET API specifies the variables and values it wants from our system.
- All API respond back in either of the 3 formats: xml or json or plaintext
2. API Parameters to prepare API Key -
$dispnumber -- The SR number.
$caller_id -- caller's number
$call_id -- unique callid
$start_time --
start time of the call
$end_time -- end time of the call
$timezone -- timezone in which the start_time and end_time is made available.
$call_duration -- duration of the call
$destination -- connected agent's number.
$action -- action that was taken (phone/voicemai
$extension -- the extension which was pressed.
Output
of one of the received packet of hookapi at server end:-
Incoming cdr: {'dispnumber': '', 'extension': '1',
'callid': 'ed29c4be-8e1b-', 'PWD': '705u8cluGWY', 'end_time': '2013-03-16
14:58:57', 'action': 'Phone', 'timezone': 'Asia/Kolkata', 'resource_url': '',
'type': 'incoming', 'start_time': '2013-03-16 14:58:57', 'UID': 'IVRadmin'}
Highlighted Items are the other static params that were
configured in the hookapi .
3. Using the API key and
the parameters provided in point number 2,
your developer will then design the API.
4. Once the API is designed and tested, you can setup that API in your SR account. (Refer Document 7.7 – for API Integration on SR)