REST API

It is an interface that allows communication between mluvii and your internal applications. You can forward the data from mluvii to your own systems using REST API calls. Due to this you keep data outside of the mluvii platform, creating customized reporting, integrating third-party systems, and much more. For example, you can automatically connect all sessions to a specific customer in CRM.

What is it used for?

The REST API allows for several useful actions. For example, you will use it when you want to transfer user information from the application to another system. It also serves to sync user statuses between mluvii and third party systems. An essential action is also the anonymization of client data. Data can be anonymized for both client data and individual Sessions.

You can also use REST API to display complete data on sessions or users application (name, surname, e-mail, ID, username). Another possibility is to generate invitations with unlimited validity and to invalidate them later. Administrators will also appreciate the option to change the look and behavior of existing packages in bulk (chat button visuals, button hiding, and forms changes).

Last but not least, due to the call to the so-called webhook method, it is possible to transmit information from mluvii to another system in real time:

  • changing operator status,

  • launching a session,

  • transfer of a session to another operator,

  • ending the session.

Swagger

The environment is located at https://app.mluvii.com/api.

Authentication

If you want to call the REST API interface, you must first have a JWT token from the authentication server. The token is valid for 1 hour, after which it has to be updated (issued again).

Mluvii REST API allows 2 ways how you can authorized yourself in accordance to OAuth 2.0 standard.

  1. Generated API username and password (client_credentials).
  2. Login via login screen (OpenID Connect)

1. API username and password

Step 1

Generate the new API password from the mluvii administration interface.

Step 2

Use the generated password to call the authentication server.

curl -X POST \
  https://app.mluvii.com/login/connect/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'response_type=token&grant_type=client_credentials&client_id=<your API username>&client_secret=<your API password>'

On premise version: curl -X POST https://{your_domain}/login/connect/token

For this step, you can use any library or tool that supports the OAuth2 standard. e.g. Postman:

Step 3

Use the JWT token returned by the authentication server to call the REST API using the http “Bearer” header.

curl -X GET https://app.mluvii.com/api/v1/Sessions/{id} \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {access-token}'

On premise version: curl -X GET https://{your_domain}/api/v1/Sessions/{id}

2. Login via login screen


Webhooks

This section describes the webhook call format. After the event is triggered, these requests are sent to the selected URL.

UserStatusChanged

Triggered when operator status changes.

Property Value
userId number
status Operator status
availabilityStatus Operator availability status
availabilityStatusReason string

SessionCreated

Triggered when a session is created by the guest’s access to the application before it is accepted by an operator or chatbot.

Property Value
id number
channel Session channel
source Session source
tenantId number

SessionStarted

Triggered when a new session starts (by an operator or chatbot).

Property Value
id number
channel Session channel
source Session source
started datetime
tenantId number

SessionForwarded

Triggered when a session is transferred.

Property Value Description
id number
channel Session channel
source Session source
time datetime
userId number omitted if not forwarded to an operator
operatorGroupId number omitted if not forwarded to a group
chatbotId number omitted if not forwarded to a chatbot
tenantId number

SessionEnded

Triggered when a session has ended (the operator or the client has finished the session).

Property Value Description
id number -
channel Session channel
source Session source
started datetime null if never started
ended datetime -
tenantId number -

SessionOperatorJoined

Triggered when an operator enters the session.

Property Value
id number
userId number
channel Session channel
source Session source
time datetime
tenantId number

SessionOperatorLeft

Triggered when an operator is disconnected from a session.

Property Value
id number
userId number
channel Session channel
source Session source
time datetime
tenantId number

SessionOperatorConcluded

Triggered after an operator ends session or when acw expires.

Property Value
id number
userId number
channel Session channel
source Session source
time datetime
tenantId number

SessionCallParamsUpdated

Triggers when the call param is changed in operator interface, when submitting hero card or call script, using feedback form or via public api.

Property Value Description
id number It is SessionId.
tenantId number -

EmailThreadCreated

Triggered when an e-mail thread is created by guest or operator.

Property Value
id number
created datetime
tenantId number

EmailThreadOperatorJoined

Triggered when an operator enters e-mail thread.

Property Value
id number
time datetime
userId number
tenantId number

EmailThreadOperatorLeft

Triggered when an operator is disconnected from e-mail thread.

Property Value
id number
time datetime
userId number
tenantId number

EmailThreadForwarded

Triggered when an e-mail thread is transferred.

Property Value Description
id number
time datetime
userId number omitted if not forwarded to an operator
operatorGroupId number omitted if not forwarded to a group
tenantId number -

GuestIdentityUpdated

Triggered after editing contact.

Property Value
id number
tenantId number

SessionActivityAvRequest

Triggered when trying to establish AV call.

Property Value
sessionId number
operatorId number

SessionActivityAvTerminated

Triggered after AV call ended.

Property Value
sessionId number
operatorId number

SessionActivityAvResponse

Triggered when guest answers AV call.

Property Value
sessionId number
operatorId number
response SessionAVRequestState

SessionActivityAvMediaResult

Triggered when AV call is established.

Property Value
sessionId number
operatorId number
isStreamAvailable bool
response GetMediaResult

SessionActivityHeroCardSubmission

Triggered when hero card is submitted.

Property Value Description
sessionId number
originalFormID number
result HeroCardSubmissionResult
submittedByClient bool if hero card is submitted by client, value will be true; otherwise if it's submitted by operator, value will be false
params dictionary contains filled in values

HeroCardSubmissionResult

Value Description
Submitted Submitted
Cancelled Filling in was cancelled

GetMediaResult

Value Description
Success Successful transfer
NoCameraOnlyMic Only microfon
NoDevices No audio/video devices
UserDenied User denied audio/video devices

SessionAVRequestState

Value Description
Requested Requested
Accepted Accepted
RejectedUser Rejected by user
RejectedNoMic Guest does not have microfon

Session source

Value Description
Default Mluvii chat
Callback Callback
Invitation Invitation
IncomingCall Incoming call
OutgoingCall Outgoing call
Campaign Campaign
API Public API
Facebook Facebook
WhatsApp WhatsApp
VK VKontakte

Session channel

Value Description
AV Audio video transfer
Chat Text channel
Phone Phone call

Operator status

Value Description
OFFLINE Offline
ONLINE Online
AWAY Away

Operator availability status

Value Description
DEFAULT Online
AWAY Away
ON_CALL AV or phone call

results matching ""

    No results matching ""