section-9134a21
API-VOICE
section-1
1 Scope
LAMVOICE is a proxy / API for sending voice calls, using an API interface.
LAMVOICE offers two interfaces:
- via Web: the user connects via a browser
- via API: the client's application exchanges information automatically with the
LAfricaMobile platform
This document describes the second way and explains how to use this API.
section-2
2 Account settings
2.1 Prerequisites
To use this API, you need a valid account. When creating your account, LAfricaMobile
must give you:
- a login (also called accountid) ( also named accountid)
- a password
This username / password pair is used as an identification parameter in the API.
2.2 Variables used in the documentation
In this document, we use values below. The real values will be given to you by our
technical team or by your own configuration (for parameters depending on your side,
callback for example). Some of them may not be used depending on your needs.
Document test values :- login=fred
- password=xpasswordx
- VOICE Server url :
https://voice.lafricamobile.com/api
You should replace these values with your own settings during your tests.
section-3
3 Upload Voice Message
3.1 How send via php
To start a campaign you must first start uploading the voice message to send.
Parameters are :
Name | Mandatory | Sample value | Comment |
---|---|---|---|
login | Y | fred | Value given by LAM |
password | Y | xpasswordx | Value given by LAM |
filename | Y | messagevocal.wav | Voice Message to send |
Here is an example with the PHP script :
RESPONSE OK
Content-Type: application/json
{
"clientFileName": "49ef5933b03f0fc1806b0084c63d30dd.wav",
"serverFileName": "jwli3kha.hqe",
"url":"http://africamobile.tel4b.com/CallManager/v1/FileDownload/temp/jwli3kha.hqe/49ef5933b03
f0fc1806b0084c63d30dd.wav",
"extension": ".wav",
"mimeType": "audio/wav"
}
ERROR
{
"error": {}
}
section-4
4 Send Voice Message
4.1 How send via php
Parameters are :
Name | Mandatory | Sample value | Comment |
---|---|---|---|
login | Y | fred | Value given by LAM |
password | Y | xpasswordx | Value given by LAM |
filename | Y | 49ef5933b03f0fc1806b0084c63d30dd.wav | voice message name after upload |
serverfilename | Y | jwli3kha.hqe | name of voice message server after upload |
campagnename | N | CAMPP | campaign name |
contacts | Y | [ 221773758085, 221774400788, 221774450792 ] | Contacts to send the message |
Here is an example with the PHP script :
RESPONSE OK
Content-Type: application/json
{"id":101,"calls":[{"id":234,"contactId":73,"contactName":"Contact_[10/04/2016:48:15]","contactFirstname":"Contact_[10/04/2016:48:15]","start":null,"called":"00221773758085","callStateId":1,"callResultId":1},{"id":236,"contactId":74,"contactName":"Contact_[10/04/2016:48:15]","contactFirstname":"Contact_[10/04/2016:48:15]","start":null,"called":"00221774400788","callStateId":1,"callResultId":1},{"id":235,"contactId":75,"contactName":"Contact_[10/04/2016:48:16]","contactFirstname":"Contact_[10/04/2016:48:16]","start":null,"called":"00221774450792","callStateId":1,"callResultId":1}],"login":null,"count":0,"processingCallCount":0,"callSuccessount":0,"callFailedCount":0,"callIgnoredCount":0,"campaignName":"CAMPP_[10/04/2016:48:18]","start":"2020-04-10T18:48:19","historyStateId":2,"messageFileName":"35"}
ERROR
{
"error": {}
}
section-5
5 Call history
Returns the list of histories
<?php
$curl = curl_init();
curl_setopt_array($curl,
array(CURLOPT_URL=>"https://voice.lafricamobile.com/api/Histories?login=fr
ed&password=xpasswordx",
CURLOPT_CUSTOMREQUEST => "GET",
));
$response = curl_exec($curl);
?>
curl_close($curl);
echo $response;
RESPONSE OK
Content-Type:application/json
[
{
"id": 0 ,
"calls": [
{
"id": 0 ,
"contactId": 0 ,
"contactName": "string",
"contactFirstname": "string",
"start": "2020-04-30T09:55:43.285Z",
"called": "string",
"callStateId": "Waiting",
"callResultId": "Waiting"
}
],
"login": "string",
"count": 0 ,
"processingCallCount": 0 ,
"callSuccessCount": 0 ,
"callFailedCount": 0 ,
"callIgnoredCount": 0 ,
"campaignName": "string",
"start": "2020-04-30T09:55:43.285Z",
"historyStateId": "Scheduled",
"messageFileName": "string"
}
]
section-6
6 Steps to follow
Download the AUDACITY software if possible from
https://www.audacityteam.org/download/
1- Record an audio file (max 1 min) on Audacity and export it in WAV format
2- Fill in the contact file leaving the ContactFunctionId column at 1 for all the contacts
3- Increment each time the ExternalId column for each new number
4- Connect to the interface
5- On mailing list, import a mailing list (Excel file)
6- On message, add a new message (import the recorded audio file)
7- On the campaign tab: new campaign, name, type of campaign (test), select the audio
message, choose the mailing list
-