General information about APIs#
API allows you to connect any of your software products (SPP) to LiraX.
Integration with LiraX solves several business problems:
- getting the name of the caller by phone number;
- obtaining the manager number assigned to the client;
- displaying information about an incoming call directly inside the RFP;
- saving the history of all calls and links to conversation recordings within the WPP;
- creating a Contact:
- Creating a task for a Contact and a manager;
- Creating a note for a Contact;
- Creating an Agreement for contact;
- Agreement Update
- making outgoing calls directly from the RPP interface.
The integration should be two-way. Therefore, some of the requests LiraX sends to the RPP towards the specified entry points, and some of the requests, on the contrary, the RPP sends to LiraX towards the single entry point.
Interaction is carried out using the HTTPS protocol. Authorization is carried out at the LiraX or VPP address, respectively, and using the authorization key obtained during the integration setup process.
Principle of authorization and interaction#
HTTPS:
- Requests to LiraX are accepted only over HTTPS. This provides a sufficient level of security for systems to interact over the Internet.
- З for the security of your data, please implement accepting requests on the WPP side also using HTTPS.
Key (token):
- Additionally, a special key (token) is used to authorize each request to LiraX. You can obtain it in the integration settings.
- Please implement accepting requests on the WPP side also using a key (token). Generate the key and paste it into the appropriate field in the integration settings section.
- Keys are created once when you set up the integration. If necessary, you can change the key on your side and update it in the LiraX interface.
Requests from LiraX to the WFP:
- Requests must be sent to the address specified in the integration settings for receiving messages, for example https://domain/LiraX.
- In the request body, you must always pass a special key in the special "token" field.
- Requests are sent in the application/x-www-form-urlencoded format
Requests from WFP to LiraX:
- The WFP should send all requests to the address specified in the integration settings.
- In the message body, the VPP must transmit the key (token) specified by you in the web cabinet.
- Requests are sent in the application/x-www-form-urlencoded format
Answers
- All responses to LiraX requests must be sent by the WFP in JSON format in the response body.
- LiraX sends all responses to WPP requests in JSON format in the response body.
List of API commands#
From runway to LiraX:
- makeCall (POST, GET)
- killCall (POST, GET)
- make2Calls (POST)
- AskQuestion (POST)
- AddTag (POST)
- DelTag (POST)
- get_sip_route_in (POST)
- set_sip_route_in (POST)
- getUserSips (POST)
- IsFreeUsers (POST)
- IsCalling (POST)
- AddCampaign (POST)
- AddPhoneCampaign (POST)
- checkContact (POST)
- getContact (POST)
- getStatInfo (POST)
- createTask (POST)
- AddTaskResult (POST)
- GetTask (POST)
- createNote (POST)
- createDeal (POST)
- updateDeal (POST)
- addBlackPhone (POST, GET)
- addBlackIP (POST, GET)
- getStages (POST)
- getShops (POST)
- getUserStatuses (POST)
- getUsers (POST)
- initStatuses (POST)
- sendMsg (POST)
- send_cloud_message (POST)
- sendSMS (POST)
- checkSMS (POST)
- EncodePhone (POST)
- DecodePhone (POST)
- set_call_lost (POST)
- get_makecall_data(POST)
- get_calls
- set_webhook
- Download call history
From LiraX to the runway:
- staton (POST)
- smsDelivered (POST)
- smsReceived (POST)
- contact (POST)
- event (POST)
- record (POST)
*All requests with Content-Type: application/x-www-form-urlencoded
API commands and examples of available scripts#
Teams from WPP to LiraX#
makeCall#
The command is needed to initiate a call from the manager to the client. As a result of successful execution of the command, LiraX will first make a call to the manager's phone, and then connect him to the client.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case makeCall | string | |
| from | short number of the employee making the outgoing call | string | |
| to | number to which the outgoing call is made | string | |
| token | liraX token set in the integration settings | string | |
| idshop | Optional parameter specifying the store ID from which the call will be made | integer | (the list of IDs can be obtained using the GetShops function) |
Example query:
POST https://api.lirax.net/general
cmd=makeCall
from=101
to=19101234567
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"id_makecall":"$id_makecall"} | OK, $id_makecall – used when receiving the makecall_finished webhook |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
killCall#
The command is needed to forcefully end a call from a manager to a client.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case killCall | string | |
| Call_id | id call received in the makecall_finished event | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=killCall
Call_id=101234234234s3
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
make2Calls#
The command is needed to connect two subscribers. As a result of successful execution of the command, LiraX will first make a call to the phone to1, and then connect it to to2. From is needed for correct call routing.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case make2Calls | string | |
| from | short number of the employee on whose behalf outgoing calls are made | string | |
| to1 | number to which the first call is made | string | |
| to2 | the number to which the second call is made or the URL of the audio file (mp3, wav) in case you only need to play the audio file | string | |
| speech | The text that should be spoken after picking up the phone to1. The text should consist of the language code (“uk “, “en “, “ru “) and the text itself | string | Optional |
| atempo | Optional parameter specifying the playback speed from 0.5 to 2.0 | string | Optional |
| timeout | Time in minutes (if more than 10, attempts will be repeated every 10 minutes until both subscribers pick up the phone). Default 0 – only one attempt | string | Optional |
| successtime | Time in seconds – How many seconds the conversation must last to be considered successful. Default 0 | string | Optional |
| notbefore | Time in hours – Until what time you cannot call. Default is 08 | string | Optional |
| notafter | Time in hours – After what hour you cannot call, Default 20 | string | Optional |
| try | Number of attempts to call back to the first party with an interval of 10 minutes | integer | Optional, default =1 |
| vtime | Time in hours and minutes – hh:mm. The parameter can be used for IVR | string | Optional |
| vdate | Date – ”dd. mm. YYYY”, ”today” or ”tomorrow”. The parameter can be used for IVR | string | Optional |
| vmoney | The value of the amount of money is a float of type 0.00 with two digits after the dot. The parameter can be used for IVR | string | Optional |
| token | liraX token set in the integration settings | string | |
| idshop | Optional parameter specifying the store ID from which the call will be made | integer | (the list of IDs can be obtained using the GetShops function) |
| FirstInternal | Optional parameter indicating that the first leg is an internal call if =1 | integer | Optional |
| SecondInternal | Optional parameter indicating that the second leg is an internal call if =1 | integer | Optional |
| SpeechNoWait | Optional parameter, if =1, specifies that speech is played instead of beeps when calling party to2 | integer | Optional |
Example query:
POST https://api.lirax.net/general
cmd=make2Calls
from=101
to1=19101234561
to2=19101234567
speech=en Hello Customer
timeout=60
successtime=30
notbefore=18
notafter=21
token=202cb962ac59075b964b07152d234b70
cmd=make2Calls
from=201
to1=19101234567
to2=https://www.test.mp3/tttt.mp3
timeout=60
successtime=30
notbefore=18
notafter=21
try=4
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"id_make2calls":"$id_make2calls"} | OK, $id_make2calls – used when receiving the make2calls_finished webhook |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
AskQuestion#
The command is needed to ask the subscriber a question and get an answer. As a result of successful execution of the command, LiraX will first make a call to the phone to1, and then play the greeting "hello", if necessary, it is possible to additionally play up to 4 messages "text1-4" in the selected language (pauses are required if necessary). Next, the question is played, if the voice recognition option is enabled, it expects the correct words in the answer "ok", if there is no recognition, we expect the button to be pressed. "From" is needed for correct call routing. The reaction is similar to the make2calls command
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case AskQuestion | string | |
| from | short number of the employee on whose behalf outgoing calls are made | string | |
| to1 | number to which the first call is made | string | |
| token | liraX token set in the integration settings | string | |
| hello | Optional parameter, the sentence must be a greeting (like Congratulations) | string | |
| text1 | Optional parameter, Message 0 | string | |
| text2 | Optional parameter, Message 0 | string | |
| text3 | Optional parameter, Message 0 | string | |
| text4 | Optional parameter, Message 0 | string | |
| bye | Optional parameter, Goodbye message, works after the question | string | |
| ask | Report a question | String | |
| ok | Words between spaces that we expect to receive in a positive answer (for example: yes ok) | String | |
| cburl | Optional parameter, URL for webhook with make2calls_finished message, which transmits data with subscriber response | String |
Example query:
POST https://api.lirax.net/general
cmd=AskQuestion
from=101
cburl=https://mydomain.co/
to1=19101234561
token=202cb962ac59075b964b07152d234b70
hello=ru Congratulations
text1=ru A new service is offered
ask=ru If you want it, say so.
ok=ru i wish so much.
bye=ru GoodbyeAnswer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"id_make2calls":"$id_make2calls"} | OK, $id_make2calls – used when receiving the make2calls_finished webhook |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
AddTag#
The team adds a tag to the contact.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case AddTag | string | |
| ani | contact phone number | string | Optional |
| tag | tag | string | Optional |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=AddTag
ani=19101234567
tag=OK
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
DelTag#
The command removes a tag from a contact.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case DelTag | string | |
| ani | contact phone number | string | Optional |
| tag | tag | string | Optional |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=DelTag
ani=19101234567
tag=OK
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
get_sip_route_in#
The command is needed to define a list of sip numbers for the phone extension.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case get_sip_route_in | string | |
| token | liraX token set in the integration settings | string | |
| phone | Internal number | string | Example: 302 |
Example query:
POST https://api.lirax.net/general
cmd=get_sip_route_in
phone=302
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | { "N":2, "description":"route_in_sip. ", "results":[ { "sip_name":"Test", "sip_number":"1115", "user_name":"User", "ext":"222", "priority":"0", "time_plan":"1" }, { "sip_name":"Test1", "sip_number":"1156", "user_name":"User1", "ext":"223", "priority":"0", "time_plan":"1" } ] } | OK, if there are no SIP numbers we will get “N”:0, N-number of SIP numbers, sip_name sIP name, sip_number – sIP number, user_name – Username, ext – user's extension number, priority – current SIP priority, time_plan – id weekly plan (work=1, evening=2, night=3, holiday=4) |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed | |
| 402 | Internal error |
set_sip_route_in#
The command is needed to set the priority of the sip number for the phone extension number.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case set_sip_route_in | string | |
| token | liraX token set in the integration settings | string | |
| phone | Internal number | string | Example: 302 |
| sip_number | sIP number | string | Example: 1115 |
| time_plan | id weekly plan (work=1, evening=2, night=3, holiday=4) | string | Example: 1 |
| priority | sIP priority for extension number | string | Example: 1 |
Example query:
POST https://api.lirax.net/general
cmd=set_sip_route_in
phone=302
sip_number=1115
priority=0
time_plan=1
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"result":"1"} | OK, if the update is successful, result=1, if there is no update, result=0 |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed | |
| 402 | Internal error |
getUserSips#
The command is needed to determine whether there are available phones for the ext.
The team caches data and updates it once an hour.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case getUserSips | string | |
| token | liraX token set in the integration settings | string | |
| ext | Internal number | string | Example: 302 |
| web | If set to > 0, then only webphones are returned | integer | Optional |
Example query:
POST https://api.lirax.net/general
cmd=getUserSips
ext=302
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"user_sips":[{"phone":"10000", "user_id":"1111", "ext":"302"}]} | OK, if there are no available sips we will get {"user_sips":[]} |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
IsFreeUsers#
The command is needed to determine whether it is possible for a user on a web phone to answer a call.
The command checks: - whether the Web phone is turned on; - whether there is no conversation with the user and returns the first free number
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case IsFreeUsers | string | |
| token | liraX token set in the integration settings | string | |
| phones | List of internal or SIP phone numbers | string | Example: 1212121, 1212123, 302 |
| amo | If set to 1, then numbers are used as amocrm user_id | string | Optional |
Example query:
POST https://api.lirax.net/general
cmd=IsFreeUsers
Phones=1212121,1212123,302
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"result":"phoneFromPhones", "sip":"sip_number", "ext":"number"} | OK, if all numbers are busy we will receive {"result":null} |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
IsCalling#
The command checks if there is a conversation with a SIP number and returns the first number without a conversation (checks registration)
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case IsFreeUsers | string | |
| token | liraX token set in the integration settings | string | |
| phones | List of internal or SIP phone numbers | string | Example: 1212121, 1212123 |
Example query:
POST https://api.lirax.net/general
cmd=IsCalling
Phones=1212121,1212123
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"result":"phoneFromPhones", "ext":"number"} | OK, if all numbers are busy we will receive {"result":null} |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
AddCampaign#
The command is needed to Create or set up a campaign to call subscribers or send SMS.
When calling subscribers, the call first goes to the user, and then to the subscriber.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case AddCampaign | string | |
| from | short number of the employee on whose behalf the campaign is being conducted | string | |
| ext | employee's short number, on which the call will be received by employees (by default it is equal to from) | string | Optional |
| days | List of days (0-Sunday, 6-Saturday) | string | Default: 1, 2, 3, 4, 5 |
| time | Time range | string | Default: 10:00-18:00 |
| pdd | Post-processing time (seconds) | integer | Default: 5 |
| preview_timeout | Outgoing call delay after employee picks up the phone (default 0) | integer | Optional |
| try | number of attempts | integer | Default: 1 |
| token | liraX token set in the integration settings | string | |
| type | Campaign type 1 - Telephone, 2 - SMS | integer | Default: 1 |
| phones | List of phone numbers (if the list is empty, the campaign stops) | string | Example: 12121234567, 12121234568 |
| message | Message text, for type=1 the first word must be language {en, uk, ru, …} (in this case it will call the subscriber first and preview_timeout is ignored) | string | Required for type=2 |
| idshop | Optional parameter specifying the store ID from which the call will be made | integer | Optional (the list of IDs can be obtained with the GetShops function) |
Note: For type=1, the number of simultaneous calls is defined in the campaign settings in the user's account.
For preview mode, the call goes to the user first, and then to the subscriber, with message!=NULL the opposite
Example query:
POST https://api.lirax.net/general
cmd=AddCampaign
from=101
days=1,2
time=10:00-11:00
timeout=60
pdd=30
try=2
idshop=2
type=2
message=Hello
Phones=12121234567,12121234568,12121234569
token=202cb962ac59075b964b07152d234b70
or
cmd=AddCampaign
from=101
days=1,2
time=10:00-11:00
timeout=60
pdd=30
try=2
idshop=2
type=1
message=en Hello
Phones=12121234567,12121234568,12121234569
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
AddPhoneCampaign#
The command is needed to add phone numbers to a campaign for calling subscribers or sending SMS.
when calling subscribers, the call first goes to the user, and then to the subscriber for preview mode, with message!=NULL the opposite
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case AddPhoneCampaign | string | |
| from | short number of the employee on whose behalf the campaign is being conducted | string | |
| token | liraX token set in the integration settings | string | |
| phones | List of phone numbers | string | Example: 12121234567, 12121234568 |
Example query:
POST https://api.lirax.net/general
cmd=AddPhoneCampaign
from=101
Phones=12121234567,12121234568,12121234569
token=202cb962ac59075b964b07152d234b70checkContact#
The command is needed to create a new or update an existing contact, the Contact Name and Responsible Employee are updated.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case checkContact | string | |
| ext | short number of the employee responsible for the contact | string | |
| ani | Contact's primary phone number | string | |
| name | contact Name | string | |
| add_phone | List of additional phones | string | Optional |
| emails | Email list | string | Optional |
| token | liraX token set in the integration settings | string | |
| trackid | Google tracking id for site | string | Optional |
| clientid | Google Client id | string | Optional |
| sitename | Site name | string | Optional |
| source | Source | string | Optional |
| stype | Source type (Medium | string | Optional |
| campain | Campaign | string | Optional |
| Term | Keyword | string | Optional |
| tag | Tag (tag is inserted if available) | string | Optional |
Example query:
POST https://api.lirax.net/general
cmd=checkContact
ext=101
ani=19101234567
Name=Dima
token=202cb962ac59075b964b07152d234b70
add_phone=380123456789,380234567890,380112345678
emails=a@a.com,b@b.comAnswer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
getContact#
The command is needed to obtain information about an existing contact and its Responsible Employee.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case getContact | string | |
| ani | contact phone number | string | Optional |
| string | Optional | ||
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=getContact
ani=19101234567
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"result":{"name":"Dmytro", "mainphone":"12345678901", "responsible":"209", "sip":"111"}} | OK Name - Contact name, mainphone – the first contact phone number, responsible - the extension number of the person in charge, sip - sip responsible person number |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
getStatInfo#
The command is needed to get statistics of calls to employees for a period of no more than a month. The command can be used no more than once an hour.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case getStatInfo | string | |
| Start | Date in the format “YYYY-MM-DD HH:MM:SS” - start of the interval | string | |
| Stop | Date in the format “YYYY-MM-DD HH:MM:SS” - end of interval | string | Optional, if absent, then in 24 hours |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=getStatInfo
Start=2021:01:01 00:00:00
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | { "results":[ { "description":"stat_info. ", "stat":[ { "login":"alex", "name":"Alexei", "count_incoming":"0", "count_incoming_unique":"0", "count_incoming_answered":"0", "count_incoming_answered_unique":"0", "count_incoming_lost":"0", "count_incoming_lost_unique":"0", "count_outgoing":"10", "count_outgoing_unique":"4", "count_outgoing_answered":"5", "count_outgoing_answered_unique":"2", "count_outgoing_lost":"5", "count_outgoing_lost_unique":"4", "incoming_duration_talk":"0", "outgoing_duration_talk":"765" } ] } ] } | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
createTask#
The command is needed to create a New Task for the Responsible Employee and Contact. If the contact does not exist, a new one is created
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case createTask | string | |
| ext | short number of the employee responsible for the contact | string | |
| department | Department Name | string | optional |
| ani | contact phone number | string | Required ani or email |
| e-mail contact | string | Required ani or email | |
| token | liraX token set in the integration settings | string | |
| webhook | URL to inform about the results | string | The text will be added at the end. |
| text | Task text | string | |
| date | Task completion date | Date | Optional, Default current time +1sec. Example: "2017-01-01 17:00:00", must be greater than the current date and less than two years in the future |
| type | Type | Integer | 1, 2, 3 (Follow-up, Meeting, Call) |
Example query:
POST https://api.lirax.net/general
cmd=createTask
ext=101
department=Sales
ani=19101234567
text=Prepare Task
date=2017-01-01 17:00:01
type=1
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"idtask":"22"} | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
AddTaskResult#
A team is needed to add a result to a task, complete a task, or change the responsible person.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case AddTaskResult | string | mandatory |
| ext | short number of the employee who added the result | string | mandatory |
| idtask | Id Task | Integer | mandatory |
| newext | New responsible | string | optional |
| finish | Completing the task | bool | optional |
| token | liraX token set in the integration settings | string | |
| text | Result text | string | mandatory |
Example query:
POST https://api.lirax.net/general
cmd=AddTaskResult
ext=101
idtask=123123
newext=191
text=The task at stage 1
finish=0
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"idtask":"123123"} | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
GetTask#
A team is needed to add a result to a task, complete a task, or change the responsible person.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case AddTaskResult | string | mandatory |
| task_id | Id Task | Integer | mandatory |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=GetTask
task_id=123123
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | { "task_id":"609", "type":"Follow-up", "date_insert":"2014-12-09 14:15:55", "date_end":"2014-12-09 15:12:07", "text":"test Task!", "ext":"101", "Name":"System", "coauthors":"1", "list":[ { "ext":"504", "Name":"Sergiy Rybalchenko" } ] } | Here type is the type of task; date_insert – creation date; date_end – date of execution; text – task text; ext – responsible; Name - name of the person responsible; coauthors - number of co-performers; list – list of co-performers |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
createNote#
The command is needed to create a note for an existing contact from the Responsible Employee.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case createNote | string | |
| ext | short number of the employee responsible for the contact | string | |
| ani | contact phone number | string | |
| token | liraX token set in the integration settings | string | |
| text | Note text | string |
Example query:
POST https://api.lirax.net/general
cmd=createNote
ext=101
ani=19101234567
text=News
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
createDeal#
The command is needed to create a New Agreement for the Responsible Employee and an existing contact.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | transaction type, in this case createDeal | string | |
| ext | short number of the employee responsible for the contact | string | |
| ani | contact phone number | string | |
| token | liraX token set in the integration settings | string | |
| name | Name of the deal | string | |
| sum | Transaction amount | Integer | |
| stage | Agreement stage | Integer | Only existing stages are allowed |
| status | Deal status (optional) | Integer | 0-Active, 1- Successfully Completed, 2- Completed Unsuccessfully |
Example query:
POST https://api.lirax.net/general
cmd=createDeal
ext=101
ani=19101234567
name=Prepare Task
sum=3030
stage=1
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"id_deal":$integer} | OK ($integer - integer) |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
updateDeal#
The command is needed to update an existing deal with id_deal for the Responsible Employee and an existing contact.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case updateDeal | string | |
| ext | short number of the employee responsible for the contact | string | |
| ani | contact phone number | string | |
| token | liraX token set in the integration settings | string | |
| id_deal | Id agreements | Integer | |
| name | Name of the deal | string | |
| sum | Transaction amount | Integer | |
| stage | Agreement stage | Integer | Only existing stages are allowed |
| status | Deal status | Integer | 0-active, 1- Successfully completed, 2- Failed |
Example query:
POST https://api.lirax.net/general
cmd=updateDeal
ext=101
ani=19101234567
id_deal=1910
name=Prepare Task
sum=3030
stage=2
status=0
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed |
addBlackPhone#
The command is needed to add a phone number to the blacklist (only numbers).
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case addBlackPhone | string | |
| phone | phone number | string | Numbers only |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=addBlackPhone
phone=100111000101
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
listBlackPhone#
The command is needed to get the Blacklist of phones.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | type of operation, in this case listBlackPhone | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=listBlackPhone
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"blacklist":["phone1", "phone2", . .. , "phoneN"]} | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
delBlackPhone#
The command is needed to remove a phone number from the Blacklist (only numbers).
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | type of operation, in this case delBlackPhone | string | |
| phone | phone number | string | Numbers only |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=delBlackPhone
phone=100111000101
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
listBlackIP#
The command is needed to get the IP address blacklist
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case listBlackIP | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=listBlackIP
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"blacklist":["IP1", "IP2", . .. , "IPN"]} | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
addBlackIP#
The command is needed to add an IP address to the Blacklist.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case addBlackIP | string | |
| IP | IP Address | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=addBlackPhone
IP=100.111.000.101
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
delBlackIP#
The command is needed to remove an IP address from the blacklist.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case delBlackIP | string | |
| IP | IP Address | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=delBlackPhone
IP=100.111.000.101
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
getStages#
The command is needed to get a list of Deal Stages sorted by Vortex.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case getStages | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=getStages
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"stages":[{"stage":$stage, "title":". .. "}, . .. ]} | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
getShops#
The command is needed to get a list of stores.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case getShops | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=getShops
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"shops":[{"id":$id_shop, "name":". .. "}, . .. ]} | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
getUserStatuses#
The command is needed to get a list of user statuses.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case getUserStatuses | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=getUserStatuses
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"statuses":[{"status":$status, "title":". .. "}, . .. ]} | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
getUsers#
The command is needed to get a list of users
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case getUsers | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=getUsers
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"users":[{"id":$id, "Name":". .. ", "ext":". .. ", "active":"0|1"}, . .. ]} | OK |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
initStatuses#
The command is needed to get the current statuses of operators via webhooks. It is used when enabling the integration. Further statuses will be received if they change; previous statuses should be ignored.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case initStatuses | string | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=initStatuses
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
sendMsg#
The command is needed to send a message to an employee in the corporate messenger.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case sendMsg | string | |
| ext | short number of the employee to whom the message is being sent | string | |
| ani | the name of the Contact who sent the message | string | |
| token | liraX token set in the integration settings | string | |
| text | Message text | string |
Example query:
POST https://api.lirax.net/general
cmd=sendMsg
ext=101
ani=19101234567
text=Prepare Task
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed |
send_cloud_message#
The command is needed to send a message to a cloud messenger (Telegram, Viber, Facebook).
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case send_cloud_message | string | |
| client | Cloud Messenger Client ID | string | mandatory in the absence of ani |
| ani | Client's phone number (only Telegram is used) | mandatory in the absence of a client | |
| token | liraX token set in the integration settings | string | |
| text | Message text | string |
Example query:
POST https://api.lirax.net/general
cmd=send_cloud_message
client=web_t123123123_00000
text=Prepare Task
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed | |
| 402 | Message not delivered |
sendSMS#
The command is needed to send SMS via GSM modem. Requests should be sent no more than once every 5 seconds per modem.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case sendSMS | string | |
| ext | short number of the employee who sends the SMS | string | Numbers only |
| provider | provider identifier (phone number in the GSM modem) | string | Numbers only |
| phone | Phone number to whom we send the message | string | |
| token | liraX token set in the integration settings | string | |
| text | Message text | string |
Example query:
POST https://api.lirax.net/general
cmd=sendSMS
ext=101
phone=19101234567
provider=380123456789
text=Prepare Task
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"id_sms":$id_sms} | OK |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed | |
| 402 | The modem is not connected | |
| 403 | The modem is busy, please try again later. |
checkSMS#
The command is needed to check the status of SMS delivery via a GSM modem. Requests should be sent no more than once every 5 seconds per modem.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case checkSMS | string | |
| ext | short number of the employee who sends the SMS | string | Numbers only |
| provider | provider identifier (phone number in the GSM modem) | string | Numbers only |
| id_sms | Id received by the sendSMS command | Integer | |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=checkSMS
ext=101
id_sms=1910123
provider=380123456789
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"sms_status":$id_status} | OK, 1- transferred to the provider, status unknown; 2- transferred to the provider, delivery is in progress; 3- delivered; 4- Delivery time has expired |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed |
EncodePhone#
The command is needed to verify the received encrypted number.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case EncodePhone | string | |
| phone | Phone number | string | Numbers only |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=EncodePhone
phone=12123123123
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"phone":$encoded} | OK |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed |
DecodePhone#
The command is needed to get the decrypted number.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case EncodePhone | string | |
| phone | Phone number | string | Numbers only |
| token | liraX token set in the integration settings | string |
Example query:
POST https://api.lirax.net/general
cmd=DecodePhone
phone=12123120960170061170799
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | {"phone":$decoded} | OK |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed |
set_call_lost#
The command is needed to set a phone number as a missed call for CallBack
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case set_call_lost | string | mandatory |
| phone | Phone number | string | Numbers only, required |
| ext | Employee phone number for CallBack | string | Numbers only, required |
| time_plan | 1 - Working hours, 2 - Evening, 3 - Night, 4 - Weekend | numbers | The time interval is defined in the weekly plan, by default 1 |
| max_try | Maximum number of attempts to connect to a subscriber (operator not included) | numbers | Default 3 |
| interval | Initial interval between attempts in minutes, multiple of 6. Subsequent interval is equal to initial interval multiplied by attempt number | numbers | Default 6 |
| minutes | Number of minutes of delay | numbers | Default 0 |
| hours | Number of hours of delay | numbers | Default 0 |
| days | Number of days of delay | numbers | Default 0 |
| weeks | Number of weeks of delay | numbers | Default 0 |
| months | Number of months of delay | numbers | Default 0 |
| info | Text that will be spoken to the employee. Format: speech and text. Example: "uk Call Back service for missed call, wait for connection with the subscriber" | string | |
| token | liraX token set in the integration settings | string | mandatory |
Example query:
POST https://api.lirax.net/general
cmd=set_call_lost
phone=12123120960
ext=222
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed | |
| 402 | Server problems |
get_makecall_data#
The command allows you to get information about the call using id_makecall, obtained by the makecall command.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case get_makecall_data | string | mandatory |
| id_makecall | resulting from makecall | string | Numbers only, required |
| token | liraX token set in the integration settings | string | mandatory |
Example query:
POST https://api.lirax.net/general
cmd=get_makecall_data
id_makecall=e5251de22f99e071
token=202cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | { "id_makecall":"e5251de22f99e071", "call_start":"2021-10-28 16:02:32", "call_record":"https://files. lirax. net/voicerec. wav", "duration":"5" } | OK |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed | |
| 402 | Server problems |
get_calls#
The command allows call log in json format (maximum 5000) for a time range. You can use the GET method for the command
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case get_calls | string | mandatory |
| date_start | Start of range | string | In SQL format, required |
| date_finish | End of range | string | In SQL format, required the interval should be less than 48 hours |
| call_type | call type, {-1, 0, 1}, in accordance {internal, input, output }, if absent, then all | numerical | optional |
| ani | Who called? | string | optional |
| dnis | Where did they call? | string | optional |
| offset | Skip the number of lines in the output | numerical | optional |
| token | liraX token set in the integration settings | string | mandatory |
Example query:
GET https://api.lirax.net/general?cmd=get_calls&date_start=2023-10-04 10:00:00&date_finish=2023-10-04 11:00:00&token=-----Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | [{"call_id":"6708", "ani":"203", "dnis":"380123123", "start":"2023-10-04 10:21:14", "connect":"2023-10-04 10:21:25", "record": "https://files. lirax. net/voice_record2/x_10_21_14. wav", "type":"1", "duration": "163", "disconnect_side":"0", "call_call_center_id":"6" }, {"call_id":"8326", "ani":"380111111", "dnis":"380123123", "start":"2023-10-04 10:04:07", "connect":"", "record":"", "type":"1", "duration":"0", "disconnect_side":"-1", "call_call_center_id":"0" }] | OK connect – if no response, there will be a blank line record – url conversation recording disconnect_side – Who hung up, -1 system (possibly due to timeout), 0 – Who called, 1 – who was called call_call_center_id – which call center handled the call (if any) |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed | |
| 402 | Server problems |
set_webhook#
The command allows call log in json format (maximum 5000) for a time range. You can use the GET method for the command
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case set_webhook | string | mandatory |
| type | "0" - input, "1" - output | numerical | mandatory |
| event_type | init - at the start of the call, trying - at the start of the outgoing leg, connect - when the subscriber picks up the phone, release - at the end of the outgoing leg, disconnect - at the end of the call | string | mandatory |
| json | JSON template to be used in the webhook body. You can use macros here: [ani] — who is calling, [dnis] — who is being called, [date] — current time, [starto] — start of the incoming call, [starta] — moment the subscriber picks up the phone, [durationo] — duration of the incoming call, [durationa] — duration of the outgoing call, [anidnis] — operator number for the incoming call, [type] — call type: "-1" — internal, "0" — incoming, "1" — outgoing. Example: {"call_type":"[type]", "event_date":"[date]", "number_a":"[ani]", "number_b":"[dnis]", "call_duration": "[durationa]"} | string | may be missing; if POST method is used then request body will be used as template |
| header_field | An additional header field that LiraX will insert into the webhook example: Authorisation: 123123123 | string | optional |
| method | GET|POST | string | Optional by default GET |
| url | Url for webhooks example: https://test. test. test. com/webhook?a=1&b=2 | string | mandatory |
| token | liraX token set in the integration settings | string | mandatory |
Example query:
GET https://api.lirax.net/general?cmd=set_webhook&type=0&event_type=disconnect&url=https://test.test.test.com/webhook?a=1&b=2
&json={"call_type":"[type]","event_date":"[date]","number_a":"[ani]","number_b":"[dnis]","call_duration":"[durationa]"}
&token=-----Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | successfully | |
| 400 | Incorrect parameters passed, or parameters not updated | |
| 401 | Invalid token passed | |
| 402 | Server problems |
Download call history#
Authorization via API
Authorizes the user in the system. All API methods can be used only after authorization.
In response to the request, upon successful authorization, in addition to the response body, a cookie file containing the session key is returned, similar to working with a WEB browser. In subsequent requests to API methods, the received cookie must be passed. The session lifetime is 15 minutes.
All requests to the API are made from the user whose attributes were used for authorization via this method. In doing so, we take into account all user rights, i.e. no more data can be obtained through the API than the user himself can see through the system interface. We recommend creating a separate user for the API for more specific settings of the rights of the connected application.
Resource URL
POST
https://lira. lirax. net/api/private/api/auth. php
Parameters
| PARAMETER | DESCRIPTION |
|---|---|
| USER_LOGIN | require User login. |
| USER_HASH | require User password. |
Calls
https://lira. lirax. net/services/call_show. php?action=show&date_start=2016-12-06 00:00:00&date_finish=2016-12-13 23:59:59&filter=call_ani_dnis&filter_value=&call_type=&call_connect=&call_export=1
date_start
Date From
date_finish
Date To
filter
Filter by field
possible values:
"call_ani", "call_dnis", "call_ani_dnis", "call_originip", "call_destination", "call_origination", "call_utm_source", "call_utm_medium", "call_utm_campaign", "call_utm_term"
filter_value
Filter value
call_type
possible values:
0 incoming, 1 outgoing
call_connect
possible values:
0 there was no conversation, 1 there was a conversation
Teams from LiraX to the runway#
makecall_finished#
The command reports the completion of the task of creating a call for 2 subscribers.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case makecall_finished | string | |
| id_makecall | Id - makecall | string | |
| Call_id | Call_id the outgoing arm of the call | string | if success=0 empty |
| success | The subscriber picked up the phone. | Integer | 0|1 |
| from_LiraX_token | the WPP token specified in the integration settings | string |
Example query:
POST https://domain/LiraX
cmd=makecall_finished
id_makecall=ef232234feb12
from_LiraX_token=303cb962ac59075b964b07152d234b70
Call_id=b964b07152d
success=1Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
make2calls_finished#
The command reports the completion of the task of creating a call for 2 subscribers.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | the type of operation, in this case make2calls_finished | string | |
| id_make2calls | Id - make2calls | string | |
| success | Was the phone picked up? | Integer | 0- there was no one, 1- picked up the phone |
| duration_success | the duration of the conversation was not less than expected in the successtime parameter | Integer | 0- less than, 1- greater than equal |
| keys | Json array of pressed buttons, ivr_name – IVR name, ivr_entry – IVR menu item, key – selected button | Json | may be absent |
| from_LiraX_token | the WPP token specified in the integration settings | string |
Example query:
POST https://domain/LiraX
cmd=make2calls_finished
id_make2calls=ef232234feb12
from_LiraX_token=303cb962ac59075b964b07152d234b70
success=1
keys=[{"ivr_name":"Test","ivr_entry":"0","key":"9"},{"ivr_name":"Test","ivr_entry":"09","key":"7"}]
duration_success=0Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
staton#
The team informs about the statuses of employees.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | type of operation, in this case staton | string | |
| ext | liraX employee extension number | string | |
| status | employee status identifier in personal account | Integer | 0- disconnected, 1- free, >1 - busy, value According to setting |
| from_LiraX_token | the WPP token specified in the integration settings | string |
Example query:
POST https://domain/LiraX
cmd=staton
ext=910
from_LiraX_token=303cb962ac59075b964b07152d234b70
status=1Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
smsDelivered#
The team informs about the delivery of SMS.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case smsDelivered | string | |
| id_sms | Id SMS, received by the sendSMS command | Integer | |
| from_LiraX_token | the WPP token specified in the integration settings | string |
Example query:
POST https://domain/LiraX
cmd=smsDelivered
from_LiraX_token=303cb962ac59075b964b07152d234b70
id_sms=1212Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
smsReceived#
The team informs about receiving an SMS.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case smsReceived | string | |
| ani | Subscriber's phone number | string | |
| id | Id SMS, received from the provider | Integer | |
| provider | Provider name (phone number) | string | |
| text | Message text | string | In UTF8 |
| from_LiraX_token | the WPP token specified in the integration settings | string |
Example query:
POST https://domain/LiraX
cmd=smsReceived
from_LiraX_token=303cb962ac59075b964b07152d234b70
id_sms=121
ani=38012345679
provider=380112345678
text=HelloAnswer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | Incorrect parameters passed | |
| 401 | Invalid token passed |
contact#
A command to obtain information about the client's name and his responsible employee by his phone number.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | type of operation, in this case contact | string | |
| phone | contact number | string | |
| callid | unique caller ID | string | |
| diversion | external LiraX phone number from which the call was received | string | when outgoing is equal to the number of the subscriber |
| from_LiraX_token | the WPP token specified in the integration settings | string |
Example query:
POST https://domain/LiraX
cmd=contact
phone=19101234567
diversion=12101234567
from_LiraX_token=303cb962ac59075b964b07152d234b70
callid=D12D0EB124F4E64AF4EA-1511Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | { "contact_name": "Ivanov Ivan Ivanovich", "responsible": 103 } | responsible — short number of the responsible user; may be absent if there is no responsible user or no short number is set for him/her |
| 400 | { "error": "Invalid parameters" } | Incorrect parameters passed |
| 401 | { "error": "Invalid token" } | Invalid token passed |
event#
LiraX sends notifications to the WPP about call events: starting, accepting or ending a call, as well as information about the call after it ends.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | type of operation, in this case event | string | |
| type | call type | in/out | incoming / outgoing |
| event | type of event associated with the call: INCOMING - an incoming call has arrived (at this time the manager's phone should start ringing). ACCEPTED - the call was successfully received (the manager picked up the phone). COMPLETED - the call is over (the manager or client hung up after the conversation). CALL_COMPLETED – the call is completely completed. | string | |
| phone | customer's phone number | string | |
| diversion | external LiraX phone number through which the call was received or made | string | |
| ext | liraX employee's extension number, in case of CALL_COMPLETED and type=in, contains the number to which the call came | string | |
| callid | unique caller ID | string | |
| duration | Call duration in seconds | int | when event=COMPLETED, CALL_COMPLETED |
| call_duration | Call duration at the time of the event in seconds | int | when event=COMPLETED, CALL_COMPLETED |
| is_recorded | is the call recorded? | 0/1 | when event=COMPLETED, CALL_COMPLETED |
| status | incoming call status: Success - successful incoming call Missed – missed incoming call outgoing call status: Success - successful outgoing call Busy - LiraX got the answer from Zanyato NotAvailable - LiraX received a response Subscriber is unavailable NotAllowed - Calls to this direction are prohibited | string | when event=COMPLETED, CALL_COMPLETED |
| record_link | link to the call recording, if LiraX can provide it immediately, if not - the link is sent by the record command | string | when event=COMPLETED, CALL_COMPLETED |
| tid | Tracking Id | ||
| cid | Client Id | ||
| cs | Source | ||
| cm | Medium | ||
| cc | Campaign | ||
| ct | Therm | ||
| keys | Last choice IVR menu | json | when event= CALL_COMPLETED |
| From_LiraX_token | the WPP token specified in the integration settings | string |
Example query:
POST https://domain/LiraX
cmd=event
type=out
event=COMPLETED
phone=19101234567
ext=102
callid=D10D0EB124F4E64AF4EA-1511
duration=124
is_recorded=1
status=Success
record_link=https://link/file.wav
keys=[{"ivr_name":"Test","ivr_entry":"09","key":"4"}]
from_LiraX_token=303cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | { "error": "Invalid parameters" } | Incorrect parameters passed |
| 401 | { "error": "Invalid token" } | Invalid token passed |
record#
The message contains information about the conversation recording.
Query parameters:
| Name | Description | Data type/format | Note |
|---|---|---|---|
| cmd | operation type, in this case record | string | |
| callid | unique caller ID | string | |
| record_link | link to call recording | string | |
| from_LiraX_token | the WPP token specified in the integration settings | string |
Example query:
POST https://domain/LiraX
cmd=record
callid=D10D0EB124F4E64AF4EA01511
record_link=https://link/file.wav
from_LiraX_token=303cb962ac59075b964b07152d234b70Answer options:
| HTTP code | Body | Description |
|---|---|---|
| 200 | OK | |
| 400 | { "error": "Invalid parameters" } | Incorrect parameters passed |
| 401 | { "error": "Invalid token" } | Invalid token passed |
ChangeLog#
2021-01-28
make2calls- firstInternal field added2021-02-18
getContact- added method2021-02-19
getStatInfo- added method2021-04-12
AskQuestion- added method2021-04-13
AddTag- added method2021-04-13
DelTag- added method2021-04-14
checkContact — tag field added2021-08-13
get_sip_route_in — added method2021-08-13
set_sip_route_in — added method2021-09-12
SecondInternal in the make2calls function2021-09-12
SpeechNoWait in the make2calls function2021-10-26
set_call_lost- added method2021-10-28
get_makecall_data - added method2021-11-19
set_call_lost - added info, minutes, hours, days, weeks, months fields2021-12-30
createTask — added email parameter, if contact does not exist, a new one is created2022-08-25
Event — call_duration parameter added2022-11-10
send_cloud_message - added method2023-10-04
get_calls- added method2023-10-20
AddTaskResult- added method2024-09-24
GetTask- added method2026-09-16
The domain api.lirax.net is used