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).

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).

1.

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=<vaše API username>&client_secret=<vaše API heslo>'

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

Pro tento krok, je možné použít libovolnou knihovnu nebo nástroj, který podporuje OAuth2 standard,. např. 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.


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.

{
  userId: number,
  status: enum { OFFLINE, ONLINE, BUSY },
  availabilityStatus: enum { DEFAULT, AWAY, IDLE, BUSY_GUESTS, EXCLUSIVE_SESSION },
  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.

{
  id: number,
  channel: enum { Chat, AV },
  source: enum { Default, Callback, Invitation, ChatInvitation, API, Facebook }
}


SessionStarted

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

{
  id: number,
  channel: enum { Chat, AV },
  source: enum { Default, Callback, Invitation, ChatInvitation, API, Facebook },
  started: datetime
}


SessionForwarded

Triggered when a session is transferred.

{
  id: number,
  channel: enum { Chat, AV },
  source: enum { Default, Callback, Invitation, ChatInvitation, API, Facebook },
  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 */
}


SessionEnded

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

{
  id: number,
  channel: enum { Chat, AV },
  source: enum { Default, Callback, Invitation, ChatInvitation, API, Facebook }
  started: datetime /* null if never started */,
  ended: datetime
}


SessionOperatorJoined

Triggered when an operator enters the session.

{
  id: number,
  userId: number,
  channel: enum { Chat, AV },
  source: enum { Default, Callback, Invitation, ChatInvitation, API, Facebook }
  time: datetime
}


SessionOperatorLeft

Triggered when an operator is disconnected from a session.

{
  id: number,
  userId: number,
  channel: enum { Chat, AV },
  source: enum { Default, Callback, Invitation, ChatInvitation, API, Facebook }
  time: datetime
}


SessionOperatorConcluded

Triggered after an operator completes the session feedback form.

{
  id: number,
  userId: number,
  channel: enum { Chat, AV },
  source: enum { Default, Callback, Invitation, ChatInvitation, API, Facebook }
  time: datetime
}

SessionCallParamsUpdated

Triggers when the output form is filled by the operator.

{
    Id: number
}

EmailThreadCreated

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

{
  id: number,
  created: datetime
}

EmailThreadOperatorJoined

Triggered when an operator enters e-mail thread.

{
  id: number,
  time: datetime,
  userId: number
}

EmailThreadOperatorLeft

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

{
  id: number,
  time: datetime,
  userId: number
}

EmailThreadForwarded

Triggered when an e-mail thread is transferred.

{
  id: number,
  time: datetime,
  userId: number /* omitted if not forwarded to an operator */,
  operatorGroupId: number /* omitted if not forwarded to a group */,
}

results matching ""

    No results matching ""