NAV Navigation
HTTP

2-Way Messaging Service v1

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Open API specification for using 2-Way Messaging Service

Base URLs:

Authentication

Retrieve authentication token

Code samples

POST https://omni.mmdsmart.com/api/auth HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json

POST /api/auth

Retrieve JWT access token you will use with further requests. You need MessageWhiz account credentials to proceed.

Body parameter

{
"email": "john.doe@example.com",
"password": "qwerty123"
}

Parameters

Name In Type Required Description
email body string(email) true User email (MessageWhiz account)
password body string true User password (MessageWhiz account)

Example responses

200 Response

{
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw",
"expires_at": 1893456000
}

Responses

Status Meaning Description
200 OK Successfully authorized
401 Unauthorized Unauthorized

Response Schema

Status Code 200

Successfully authorized

Name Type Description
» token string(byte) User token used for authorization
» expires_at number Token expiration timestamp in Unix time

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Channels

Get all channels

Code samples

GET https://omni.mmdsmart.com/api/channels HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/channels

Retrieve all channels for current user.

Parameters

Name In Type Required Description
offset query number false Sets the first position to return from the results of the request. Default - 0
limit query number false The number of entities to return in result. Default - 50
sort query string false The field by which entities in result are sorted. Default - created
order query string false Direction of entities sorting - ascending (asc) or descending (desc). Default - asc
search query string false The field by which entities in result are searched
name query string false Could be used to filter channels by name field
status query string false Could be used to filter channels by status field
type query string false Could be used to filter channels by type field
Authorization header string true User token used for authorization

Enumerated Values

status: INACTIVE CREATED HOLD ON_APPROVAL ACTIVE

type: RCS SMS WA TG VI WECHAT

Example responses

200 Response

{
"channels": [
{
"_id": "3dec4223-7900-4842-b5d9-14e1d87885cc",
"type": "SMS",
"chatbot": {
"story_id": "60197939f14a550007fa0d01",
"origin": "OWN"
},
"keyword_events_messages": {
"opt_out_message": "We are so sorry you are leaving. Hope to see you back again.",
"help_message": "We'll help you as soon as possible."
},
"config": {
"type": "SMS",
"name": "SMS USA",
"region": "NA",
"country": "US",
"short_code": null,
"mw_sender_list_id": null
},
"created": "2020-11-02T11:48:05.855Z",
"modified": "2021-02-10T22:35:03.244Z",
"agents": [
{
"_id": "2818c969-05ee-43a1-b4eb-06d338f5e256",
"created": "2020-07-23T11:20:48.444Z",
"modified": "2020-11-02T11:48:05.853Z",
"config": {
"vln": "145044111206"
}
}
]
}
],
"total": 1,
"offset": 0,
"limit": 50
}

Responses

Status Meaning Description
200 OK Successfully returned channels
401 Unauthorized Unauthorized

Response Schema

Status Code 200

Successfully returned channels

Name Type Description
» channels [object] Current user channels
»» _id string(uuid) Channel ID in database
»» chatbot object ID of chatbot story from chatbot.com service or from 2-way chatbot service
»»» story_id string ID of chatbot story from chatbot.com service or from 2-way chatbot service
»»» origin string Service to which the provided story ID belongs
»» keyword_events_messages object Messages for opt-out and help keyword events
»»» opt_out_message string Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
»»» help_message string Message will be sent to customer after help keyword event is triggered (160 characters max)
»» welcome_message string Message will be sent to customer after a first opt-in procedure (160 characters max)
»» type string Channel type
»» status string Channel status
»» created string(date-time) Channel creating timestamp
»» modified string(date-time) Channel updating timestamp
»» agents [object] Current channel agents list. For different channel types agent could be something special: VLN is an agent of SMS channel, bot is Telegram channel’s agent, and so on. Only SMS channel may have more than one child agent. Agent(s) are created automatically when you create a new channel
»»» _id string(uuid) Agent ID in database
»»» created string(date-time) Agent creating timestamp
»»» modified string(date-time) Agent updating timestamp
»»» config object
»» config any Channel config. Config fields are different for different channel types

anyOf

Name Type Description
object Config for SMS channel type
»»»» name string Channel name (50 characters max)
»»»» mw_sender_list_id string MessageWhiz sender list with current channel VLNs
»»»» region string Channel region
»»»» country string VLN will be created with origination of provided country
»»»» short_code string Digit sequences, shorter than telephone numbers, that are used to address messages in SMS. Short codes are unique to each operator
»»»» type string Channel type

or

Name Type Description
object Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»»»» name string Channel name (50 characters max)
»»»» type string Channel type

or

Name Type Description
object Config for RCS channel type
»»»» name string Channel name (40 characters max)
»»»» region string Region determines where RCS agent operates from and where it stores its data
»»»» country [string] List of countries channel will operate with
»»»» description string Channel description (100 characters max)
»»»» color string (format #AABBCC). Contrast ratio must be at least 4.5 or above on white background
»»»» banner string(uri) 1440x448 px JPEG, no larger than 220 KB
»»»» logo string(uri) 224x224 px JPEG, no larger than 50 KB. Make sure that your logo displays well as a circle
»»»» phone string Customer facing phone number
»»»» label_phone string Label for the customer facing phone number (25 characters max)
»»»» website string(uri) Website URL
»»»» label_website string Label for website (25 characters max)
»»»» email string(email) Customer facing email address
»»»» label_email string Label for the customer facing email address (25 characters max)
»»»» privacy string(uri) Privacy policy URL
»»»» terms string(uri) Terms of service URL
»»»» category string Channel category
»»»» type string Channel type

or

Name Type Description
object Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»»»» name string Channel name (50 characters max)
»»»» type string Channel type

continued

Name Type Description
» total number Total amount of entities for current user
» offset number Sets the first position to return from the results of the request. Default - 0
» limit number The number of entities to return in result. Default - 50

Enumerated Values

origin: OWN CHATBOT_COM DIALOGFLOW

type: ECHO RCS SMS WA TG VI WECHAT

status: INACTIVE CREATED HOLD ON_APPROVAL ACTIVE

region: NA EU ME AP

country: AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BG BH BI BJ BL BM BN BO BS BT BV BY BZ CC CD CF CG CH CK CM CN CU CV CW CX CY CZ DE DJ DK DM DO DZ EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GG GH GI GL GM GN GP GQ GR GS GU GW GY HK HM HR HT HU ID IE IL IM IO IQ IR IS JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MY MZ NA NC NE NF NL NO NP NR NU NZ OM PF PG PK PM PN PS PT PW QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SO SR SS ST SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW BW BR BF CA CL CO CR EC SV FR GT HN IN CI IT MX NI NG PA PY PE PL PH PR SN ES GB UY US

category: Education Entertainment Finance Food & Drinks Health & Fitness Home & Auto Lifestyle News Productivity Religion and Spirituality Shopping & Retail Sports Travel Others

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Create a channel

Code samples

POST https://omni.mmdsmart.com/api/channels HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/channels

Create a new channel for current user.

Body parameter

{
"_id": "1f704bc5-5055-43eb-a851-c87b6b0bf7b9",
"chatbot": {
"story_id": "60197939f14a550007fa0d01",
"origin": "CHATBOT.COM"
},
"keyword_events_messages": {
"opt_out_message": "We are so sorry you are leaving. Hope to see you back again.",
"help_message": "We'll help you as soon as possible."
},
"welcome_message": "Welcome to our business! How can we help you?",
"type": "SMS",
"vln_quantity": 1,
"config": {
"name": "Test channel",
"mw_sender_list_id": "string",
"region": "NA",
"country": "AD",
"short_code": "string"
}
}

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization
<—> <—> <—> <—> Payload for SMS channel type
» _id body string(uuid) false Channel ID in database
» chatbot body object false ID of chatbot story from chatbot.com service or from 2-way chatbot service
»» story_id body string false ID of chatbot story from chatbot.com service or from 2-way chatbot service
»» origin body string false Service to which the provided story ID belongs
» keyword_events_messages body object false Messages for opt-out and help keyword events
»» opt_out_message body string false Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
»» help_message body string false Message will be sent to customer after help keyword event is triggered (160 characters max)
» welcome_message body string false Message will be sent to customer after a first opt-in procedure (160 characters max)
» type body string true Channel type
» vln_quantity body number false VLNs quantity for SMS channel
» config body object false Config for SMS channel type
»» name body string true Channel name (50 characters max)
»» mw_sender_list_id body string false MessageWhiz sender list with current channel VLNs
»» region body string true Channel region
»» country body string true VLN will be created with origination of provided country
»» short_code body string false Digit sequences, shorter than telephone numbers, that are used to address messages in SMS. Short codes are unique to each operator
<—> <—> <—> <—> Payload for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
» _id body string(uuid) false Channel ID in database
» chatbot body object false ID of chatbot story from chatbot.com service or from 2-way chatbot service
»» story_id body string false ID of chatbot story from chatbot.com service or from 2-way chatbot service
»» origin body string false Service to which the provided story ID belongs
» keyword_events_messages body object false Messages for opt-out and help keyword events
»» opt_out_message body string false Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
»» help_message body string false Message will be sent to customer after help keyword event is triggered (160 characters max)
» welcome_message body string false Message will be sent to customer after a first opt-in procedure (160 characters max)
» type body string true Channel type
» config body object false Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»» name body string true Channel name (50 characters max)
<—> <—> <—> <—> Payload for RCS channel type
» _id body string(uuid) false Channel ID in database
» chatbot body object false ID of chatbot story from chatbot.com service or from 2-way chatbot service
»» story_id body string false ID of chatbot story from chatbot.com service or from 2-way chatbot service
»» origin body string false Service to which the provided story ID belongs
» keyword_events_messages body object false Messages for opt-out and help keyword events
»» opt_out_message body string false Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
»» help_message body string false Message will be sent to customer after help keyword event is triggered (160 characters max)
» welcome_message body string false Message will be sent to customer after a first opt-in procedure (160 characters max)
» type body string true Channel type
» config body object false Config for RCS channel type
»» name body string true Channel name (40 characters max)
»» region body string false Region determines where RCS agent operates from and where it stores its data
»» country body [string] true List of countries channel will operate with
»» description body string true Channel description (100 characters max)
»» color body string true (format #AABBCC). Contrast ratio must be at least 4.5 or above on white background
»» banner body string(uri) false 1440x448 px JPEG, no larger than 220 KB
»» logo body string(uri) true 224x224 px JPEG, no larger than 50 KB. Make sure that your logo displays well as a circle
»» phone body string true Customer facing phone number
»» label_phone body string false Label for the customer facing phone number (25 characters max)
»» website body string(uri) true Website URL
»» label_website body string false Label for website (25 characters max)
»» email body string(email) true Customer facing email address
»» label_email body string false Label for the customer facing email address (25 characters max)
»» privacy body string(uri) true Privacy policy URL
»» terms body string(uri) true Terms of service URL
»» category body string false Channel category
<—> <—> <—> <—> Payload for TG channel type
» _id body string(uuid) false Channel ID in database
» chatbot body object false ID of chatbot story from chatbot.com service or from 2-way chatbot service
»» story_id body string false ID of chatbot story from chatbot.com service or from 2-way chatbot service
»» origin body string false Service to which the provided story ID belongs
» keyword_events_messages body object false Messages for opt-out and help keyword events
»» opt_out_message body string false Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
»» help_message body string false Message will be sent to customer after help keyword event is triggered (160 characters max)
» welcome_message body string false Message will be sent to customer after a first opt-in procedure (160 characters max)
» type body string true Channel type
» config body object false Config for TG channel type
»» name body string true Channel name (50 characters max)
»» bot_name body string true Telegram chatbot’s bot name (usually ends with Bot)
»» access_token body string true Access token issued by Telegram

Enumerated Values

»» origin: OWN CHATBOT_COM DIALOGFLOW

» type: SMS WA VI WECHAT RCS TG

»» region: NA EU ME AP

»» country: AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BG BH BI BJ BL BM BN BO BS BT BV BY BZ CC CD CF CG CH CK CM CN CU CV CW CX CY CZ DE DJ DK DM DO DZ EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GG GH GI GL GM GN GP GQ GR GS GU GW GY HK HM HR HT HU ID IE IL IM IO IQ IR IS JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MY MZ NA NC NE NF NL NO NP NR NU NZ OM PF PG PK PM PN PS PT PW QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SO SR SS ST SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW BW BR BF CA CL CO CR EC SV FR GT HN IN CI IT MX NI NG PA PY PE PL PH PR SN ES GB UY US

»» category: Education Entertainment Finance Food & Drinks Health & Fitness Home & Auto Lifestyle News Productivity Religion and Spirituality Shopping & Retail Sports Travel Others

Example responses

201 Response

{
"channel": {
"_id": "1f704bc5-5055-43eb-a851-c87b6b0bf7b9",
"chatbot": {
"story_id": "60197939f14a550007fa0d01",
"origin": "CHATBOT.COM"
},
"keyword_events_messages": {
"opt_out_message": "We are so sorry you are leaving. Hope to see you back again.",
"help_message": "We'll help you as soon as possible."
},
"welcome_message": "Welcome to our business! How can we help you?",
"type": "SMS",
"status": "ACTIVE",
"created": "2019-08-24T14:15:22Z",
"modified": "2019-08-24T14:15:22Z",
"agents": [
{
"_id": "1f704bc5-5055-43eb-a851-c87b6b0bf7b9",
"created": "2019-08-24T14:15:22Z",
"modified": "2019-08-24T14:15:22Z",
"config": {}
}
],
"config": {
"name": "Test channel",
"mw_sender_list_id": "string",
"region": "NA",
"country": "AD",
"short_code": "string",
"type": "SMS"
}
}
}

Responses

Status Meaning Description
201 Created Successfully created a channel
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
409 Conflict Conflict

Response Schema

Status Code 201

Successfully created a channel

Name Type Description
» channel object Channel is a key entity for performing a communication with a customer. You can have multiple channels of different types simultaneously
»» _id string(uuid) Channel ID in database
»» chatbot object ID of chatbot story from chatbot.com service or from 2-way chatbot service
»»» story_id string ID of chatbot story from chatbot.com service or from 2-way chatbot service
»»» origin string Service to which the provided story ID belongs
»» keyword_events_messages object Messages for opt-out and help keyword events
»»» opt_out_message string Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
»»» help_message string Message will be sent to customer after help keyword event is triggered (160 characters max)
»» welcome_message string Message will be sent to customer after a first opt-in procedure (160 characters max)
»» type string Channel type
»» status string Channel status
»» created string(date-time) Channel creating timestamp
»» modified string(date-time) Channel updating timestamp
»» agents [object] Current channel agents list. For different channel types agent could be something special: VLN is an agent of SMS channel, bot is Telegram channel’s agent, and so on. Only SMS channel may have more than one child agent. Agent(s) are created automatically when you create a new channel
»»» _id string(uuid) Agent ID in database
»»» created string(date-time) Agent creating timestamp
»»» modified string(date-time) Agent updating timestamp
»»» config object
»» config any Channel config. Config fields are different for different channel types

anyOf

Name Type Description
object Config for SMS channel type
»»»» name string Channel name (50 characters max)
»»»» mw_sender_list_id string MessageWhiz sender list with current channel VLNs
»»»» region string Channel region
»»»» country string VLN will be created with origination of provided country
»»»» short_code string Digit sequences, shorter than telephone numbers, that are used to address messages in SMS. Short codes are unique to each operator
»»»» type string Channel type

or

Name Type Description
object Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»»»» name string Channel name (50 characters max)
»»»» type string Channel type

or

Name Type Description
object Config for RCS channel type
»»»» name string Channel name (40 characters max)
»»»» region string Region determines where RCS agent operates from and where it stores its data
»»»» country [string] List of countries channel will operate with
»»»» description string Channel description (100 characters max)
»»»» color string (format #AABBCC). Contrast ratio must be at least 4.5 or above on white background
»»»» banner string(uri) 1440x448 px JPEG, no larger than 220 KB
»»»» logo string(uri) 224x224 px JPEG, no larger than 50 KB. Make sure that your logo displays well as a circle
»»»» phone string Customer facing phone number
»»»» label_phone string Label for the customer facing phone number (25 characters max)
»»»» website string(uri) Website URL
»»»» label_website string Label for website (25 characters max)
»»»» email string(email) Customer facing email address
»»»» label_email string Label for the customer facing email address (25 characters max)
»»»» privacy string(uri) Privacy policy URL
»»»» terms string(uri) Terms of service URL
»»»» category string Channel category
»»»» type string Channel type

or

Name Type Description
object Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»»»» name string Channel name (50 characters max)
»»»» type string Channel type

Enumerated Values

origin: OWN CHATBOT_COM DIALOGFLOW

type: ECHO RCS SMS WA TG VI WECHAT

status: INACTIVE CREATED HOLD ON_APPROVAL ACTIVE

region: NA EU ME AP

country: AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BG BH BI BJ BL BM BN BO BS BT BV BY BZ CC CD CF CG CH CK CM CN CU CV CW CX CY CZ DE DJ DK DM DO DZ EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GG GH GI GL GM GN GP GQ GR GS GU GW GY HK HM HR HT HU ID IE IL IM IO IQ IR IS JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MY MZ NA NC NE NF NL NO NP NR NU NZ OM PF PG PK PM PN PS PT PW QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SO SR SS ST SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW BW BR BF CA CL CO CR EC SV FR GT HN IN CI IT MX NI NG PA PY PE PL PH PR SN ES GB UY US

category: Education Entertainment Finance Food & Drinks Health & Fitness Home & Auto Lifestyle News Productivity Religion and Spirituality Shopping & Retail Sports Travel Others

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 409

Conflict

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get a specific channel

Code samples

GET https://omni.mmdsmart.com/api/channels/{channel_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/channels/{channel_id}

Retrieve a specific channel by ID.

Parameters

Name In Type Required Description
channel_id path string(uuid) true Channel ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{
"channel": {
"_id": "3f274b3a-78dc-ece5-20aa-3806a880b175",
"type": "SMS",
"modified": "2021-02-10T22:35:03.244Z",
"chatbot": {
"story_id": "60197939f14a550007fa0d01",
"origin": "OWN"
},
"keyword_events_messages": {
"opt_out_message": "We are so sorry you are leaving. Hope to see you back again.",
"help_message": "We'll help you as soon as possible."
},
"config": {
"type": "SMS",
"name": "SMS USA",
"region": "US",
"country": "USA",
"short_code": null,
"mw_sender_list_id": null
},
"created": "2020-11-02T11:48:05.855Z",
"agents": [
{
"_id": "2818c969-05ee-43a1-b4eb-06d338f5e256",
"created": "2020-07-23T11:20:48.444Z",
"modified": "2020-11-02T11:48:05.853Z",
"config": {
"vln": "145044111206"
}
}
]
}
}

Responses

Status Meaning Description
200 OK Successfully returned channel
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Successfully returned channel

Name Type Description
» channel object Channel is a key entity for performing a communication with a customer. You can have multiple channels of different types simultaneously
»» _id string(uuid) Channel ID in database
»» chatbot object ID of chatbot story from chatbot.com service or from 2-way chatbot service
»»» story_id string ID of chatbot story from chatbot.com service or from 2-way chatbot service
»»» origin string Service to which the provided story ID belongs
»» keyword_events_messages object Messages for opt-out and help keyword events
»»» opt_out_message string Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
»»» help_message string Message will be sent to customer after help keyword event is triggered (160 characters max)
»» welcome_message string Message will be sent to customer after a first opt-in procedure (160 characters max)
»» type string Channel type
»» status string Channel status
»» created string(date-time) Channel creating timestamp
»» modified string(date-time) Channel updating timestamp
»» agents [object] Current channel agents list. For different channel types agent could be something special: VLN is an agent of SMS channel, bot is Telegram channel’s agent, and so on. Only SMS channel may have more than one child agent. Agent(s) are created automatically when you create a new channel
»»» _id string(uuid) Agent ID in database
»»» created string(date-time) Agent creating timestamp
»»» modified string(date-time) Agent updating timestamp
»»» config object
»» config any Channel config. Config fields are different for different channel types

anyOf

Name Type Description
object Config for SMS channel type
»»»» name string Channel name (50 characters max)
»»»» mw_sender_list_id string MessageWhiz sender list with current channel VLNs
»»»» region string Channel region
»»»» country string VLN will be created with origination of provided country
»»»» short_code string Digit sequences, shorter than telephone numbers, that are used to address messages in SMS. Short codes are unique to each operator
»»»» type string Channel type

or

Name Type Description
object Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»»»» name string Channel name (50 characters max)
»»»» type string Channel type

or

Name Type Description
object Config for RCS channel type
»»»» name string Channel name (40 characters max)
»»»» region string Region determines where RCS agent operates from and where it stores its data
»»»» country [string] List of countries channel will operate with
»»»» description string Channel description (100 characters max)
»»»» color string (format #AABBCC). Contrast ratio must be at least 4.5 or above on white background
»»»» banner string(uri) 1440x448 px JPEG, no larger than 220 KB
»»»» logo string(uri) 224x224 px JPEG, no larger than 50 KB. Make sure that your logo displays well as a circle
»»»» phone string Customer facing phone number
»»»» label_phone string Label for the customer facing phone number (25 characters max)
»»»» website string(uri) Website URL
»»»» label_website string Label for website (25 characters max)
»»»» email string(email) Customer facing email address
»»»» label_email string Label for the customer facing email address (25 characters max)
»»»» privacy string(uri) Privacy policy URL
»»»» terms string(uri) Terms of service URL
»»»» category string Channel category
»»»» type string Channel type

or

Name Type Description
object Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»»»» name string Channel name (50 characters max)
»»»» type string Channel type

Enumerated Values

origin: OWN CHATBOT_COM DIALOGFLOW

type: ECHO RCS SMS WA TG VI WECHAT

status: INACTIVE CREATED HOLD ON_APPROVAL ACTIVE

region: NA EU ME AP

country: AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BG BH BI BJ BL BM BN BO BS BT BV BY BZ CC CD CF CG CH CK CM CN CU CV CW CX CY CZ DE DJ DK DM DO DZ EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GG GH GI GL GM GN GP GQ GR GS GU GW GY HK HM HR HT HU ID IE IL IM IO IQ IR IS JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MY MZ NA NC NE NF NL NO NP NR NU NZ OM PF PG PK PM PN PS PT PW QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SO SR SS ST SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW BW BR BF CA CL CO CR EC SV FR GT HN IN CI IT MX NI NG PA PY PE PL PH PR SN ES GB UY US

category: Education Entertainment Finance Food & Drinks Health & Fitness Home & Auto Lifestyle News Productivity Religion and Spirituality Shopping & Retail Sports Travel Others

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Modify a specific channel

Code samples

PATCH https://omni.mmdsmart.com/api/channels/{channel_id} HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

PATCH /api/channels/{channel_id}

Modify a specific channel by ID.

Body parameter

{
"chatbot": {
"story_id": "60197939f14a550007fa0d01",
"origin": "CHATBOT.COM"
},
"keyword_events_messages": {
"opt_out_message": "We are so sorry you are leaving. Hope to see you back again.",
"help_message": "We'll help you as soon as possible."
},
"welcome_message": "Welcome to our business! How can we help you?",
"config": {
"name": "Corporate notifications"
}
}

Parameters

Name In Type Required Description
channel_id path string(uuid) true Channel ID in database
Authorization header string true User token used for authorization
chatbot body object false ID of chatbot story from chatbot.com service or from 2-way chatbot service
» story_id body string false ID of chatbot story from chatbot.com service or from 2-way chatbot service
» origin body string false Service to which the provided story ID belongs
keyword_events_messages body object false Messages for opt-out and help keyword events
» opt_out_message body string false Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
» help_message body string false Message will be sent to customer after help keyword event is triggered (160 characters max)
welcome_message body string false Message will be sent to customer after a first opt-in procedure (160 characters max)
config body object false Channel config
» name body string false Channel name

Enumerated Values

» origin: OWN CHATBOT_COM DIALOGFLOW

Example responses

200 Response

{
"channel": {
"_id": "3f274b3a-78dc-ece5-20aa-3806a880b175",
"type": "SMS",
"modified": "2021-02-10T22:35:03.244Z",
"chatbot": {
"story_id": "60197939f14a550007fa0d01",
"origin": "OWN"
},
"keyword_events_messages": {
"opt_out_message": "We are so sorry you are leaving. Hope to see you back again.",
"help_message": "We'll help you as soon as possible."
},
"config": {
"type": "SMS",
"name": "Corporate notifications",
"region": "US",
"country": "USA",
"short_code": null,
"mw_sender_list_id": null
},
"created": "2020-11-02T11:48:05.855Z",
"agents": [
{
"_id": "2818c969-05ee-43a1-b4eb-06d338f5e256",
"config": {
"vln": "145044111206"
},
"created": "2020-07-23T11:20:48.444Z",
"modified": "2020-11-02T11:48:05.853Z"
}
]
}
}

Responses

Status Meaning Description
200 OK Successfully updated channel
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found

Response Schema

Status Code 200

Successfully updated channel

Name Type Description
» channel object Channel is a key entity for performing a communication with a customer. You can have multiple channels of different types simultaneously
»» _id string(uuid) Channel ID in database
»» chatbot object ID of chatbot story from chatbot.com service or from 2-way chatbot service
»»» story_id string ID of chatbot story from chatbot.com service or from 2-way chatbot service
»»» origin string Service to which the provided story ID belongs
»» keyword_events_messages object Messages for opt-out and help keyword events
»»» opt_out_message string Message will be sent to customer after opt-out keyword event is triggered (160 characters max)
»»» help_message string Message will be sent to customer after help keyword event is triggered (160 characters max)
»» welcome_message string Message will be sent to customer after a first opt-in procedure (160 characters max)
»» type string Channel type
»» status string Channel status
»» created string(date-time) Channel creating timestamp
»» modified string(date-time) Channel updating timestamp
»» agents [object] Current channel agents list. For different channel types agent could be something special: VLN is an agent of SMS channel, bot is Telegram channel’s agent, and so on. Only SMS channel may have more than one child agent. Agent(s) are created automatically when you create a new channel
»»» _id string(uuid) Agent ID in database
»»» created string(date-time) Agent creating timestamp
»»» modified string(date-time) Agent updating timestamp
»»» config object
»» config any Channel config. Config fields are different for different channel types

anyOf

Name Type Description
object Config for SMS channel type
»»»» name string Channel name (50 characters max)
»»»» mw_sender_list_id string MessageWhiz sender list with current channel VLNs
»»»» region string Channel region
»»»» country string VLN will be created with origination of provided country
»»»» short_code string Digit sequences, shorter than telephone numbers, that are used to address messages in SMS. Short codes are unique to each operator
»»»» type string Channel type

or

Name Type Description
object Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»»»» name string Channel name (50 characters max)
»»»» type string Channel type

or

Name Type Description
object Config for RCS channel type
»»»» name string Channel name (40 characters max)
»»»» region string Region determines where RCS agent operates from and where it stores its data
»»»» country [string] List of countries channel will operate with
»»»» description string Channel description (100 characters max)
»»»» color string (format #AABBCC). Contrast ratio must be at least 4.5 or above on white background
»»»» banner string(uri) 1440x448 px JPEG, no larger than 220 KB
»»»» logo string(uri) 224x224 px JPEG, no larger than 50 KB. Make sure that your logo displays well as a circle
»»»» phone string Customer facing phone number
»»»» label_phone string Label for the customer facing phone number (25 characters max)
»»»» website string(uri) Website URL
»»»» label_website string Label for website (25 characters max)
»»»» email string(email) Customer facing email address
»»»» label_email string Label for the customer facing email address (25 characters max)
»»»» privacy string(uri) Privacy policy URL
»»»» terms string(uri) Terms of service URL
»»»» category string Channel category
»»»» type string Channel type

or

Name Type Description
object Config for WhatsApp (WA), Viber (VI), WeChat (WECHAT) channel types
»»»» name string Channel name (50 characters max)
»»»» type string Channel type

Enumerated Values

origin: OWN CHATBOT_COM DIALOGFLOW

type: ECHO RCS SMS WA TG VI WECHAT

status: INACTIVE CREATED HOLD ON_APPROVAL ACTIVE

region: NA EU ME AP

country: AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BG BH BI BJ BL BM BN BO BS BT BV BY BZ CC CD CF CG CH CK CM CN CU CV CW CX CY CZ DE DJ DK DM DO DZ EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GG GH GI GL GM GN GP GQ GR GS GU GW GY HK HM HR HT HU ID IE IL IM IO IQ IR IS JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MY MZ NA NC NE NF NL NO NP NR NU NZ OM PF PG PK PM PN PS PT PW QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SO SR SS ST SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW BW BR BF CA CL CO CR EC SV FR GT HN IN CI IT MX NI NG PA PY PE PL PH PR SN ES GB UY US

category: Education Entertainment Finance Food & Drinks Health & Fitness Home & Auto Lifestyle News Productivity Religion and Spirituality Shopping & Retail Sports Travel Others

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Delete a specific channel

Code samples

DELETE https://omni.mmdsmart.com/api/channels/{channel_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

DELETE /api/channels/{channel_id}

Remove a specific channel by ID.

Parameters

Name In Type Required Description
channel_id path string(uuid) true Channel ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{
"success": true
}

Responses

Status Meaning Description
200 OK Channel was successfully removed
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Channel was successfully removed

Name Type Description
» success boolean Whether the request was successfully processed

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get a specific agent

Code samples

GET https://omni.mmdsmart.com/api/channels/{channel_id}/agents/{agent_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/channels/{channel_id}/agents/{agent_id}

Obtain a specific agent by ID.

Parameters

Name In Type Required Description
channel_id path string(uuid) true Channel ID in database
agent_id path string(uuid) true Agent ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{
"_id": "1f704bc5-5055-43eb-a851-c87b6b0bf7b9",
"created": "2019-08-24T14:15:22Z",
"modified": "2019-08-24T14:15:22Z",
"config": {}
}

Responses

Status Meaning Description
200 OK
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Name Type Description
» _id string(uuid) Agent ID in database
» created string(date-time) Agent creating timestamp
» modified string(date-time) Agent updating timestamp
» config object

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Delete a specific agent

Code samples

DELETE https://omni.mmdsmart.com/api/channels/{channel_id}/agents/{agent_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

DELETE /api/channels/{channel_id}/agents/{agent_id}

Remove a specific agent by ID.

Parameters

Name In Type Required Description
channel_id path string(uuid) true Channel ID in database
agent_id path string(uuid) true Agent ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{
"success": true
}

Responses

Status Meaning Description
200 OK Agent was successfully removed
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Agent was successfully removed

Name Type Description
» success boolean Whether the request was successfully processed

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Modify a specific agent

Code samples

PATCH https://omni.mmdsmart.com/api/channels/{channel_id}/agents/{agent_id} HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

PATCH /api/channels/{channel_id}/agents/{agent_id}

Modify a specific agent by channelID and agent ID.

Body parameter

{
"chatbot": {
"story_id": "60197939f14a550007fa0d01",
"origin": "CHATBOT.COM"
}
}

Parameters

Name In Type Required Description
channel_id path string(uuid) true Channel ID in database
agent_id path string(uuid) true Agent ID in database
Authorization header string true User token used for authorization
chatbot body object true ID of chatbot story from chatbot.com service or from 2-way chatbot service
» story_id body string true ID of chatbot story from chatbot.com service or from 2-way chatbot service
» origin body string true Service to which the provided story ID belongs

Enumerated Values

» origin: OWN CHATBOT_COM DIALOGFLOW

Example responses

204 Response

{}

Responses

Status Meaning Description
204 No Content Agent was successfully updated
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 204

Agent was successfully updated

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Create agents

Code samples

POST https://omni.mmdsmart.com/api/channels/{channel_id}/agents HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/channels/{channel_id}/agents

Create a new agent for current user.

Body parameter

{
"type": "SMS",
"provider": "IZONET",
"vln_quantity": 1
}

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization
type body string true Channel type
provider body string true Provider
vln_quantity body number true VLNs quantity for SMS channel

Enumerated Values

type: SMS

provider: IZONET

Example responses

201 Response

[
{
"_id": "1f704bc5-5055-43eb-a851-c87b6b0bf7b9",
"created": "2019-08-24T14:15:22Z",
"modified": "2019-08-24T14:15:22Z",
"config": {}
}
]

Responses

Status Meaning Description
201 Created Current channel agents list. For different channel types agent could be something special: VLN is an agent of SMS channel, bot is Telegram channel’s agent, and so on. Only SMS channel may have more than one child agent. Agent(s) are created automatically when you create a new channel
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
409 Conflict Conflict
410 Gone Entity was removed

Response Schema

Status Code 201

Current channel agents list. For different channel types agent could be something special: VLN is an agent of SMS channel, bot is Telegram channel’s agent, and so on. Only SMS channel may have more than one child agent. Agent(s) are created automatically when you create a new channel

Name Type Description
» _id string(uuid) Agent ID in database
» created string(date-time) Agent creating timestamp
» modified string(date-time) Agent updating timestamp
» config object

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 409

Conflict

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Chatbot channel options

Code samples

PUT https://omni.mmdsmart.com/api/channels/chatbot HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

PUT /api/channels/chatbot

Set chatbot settings to channels.

Body parameter

{
"story_id": "c8fb5604-7434-4d42-a55d-68b411ad0f30",
"origin": "OWN"
}

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization
story_id body string true This scenario id would set to all channels in chatbot.story_id settings
origin body string false This origin would set to all channels in chatbot.origin settings

Enumerated Values

origin: OWN CHATBOT_COM DIALOGFLOW

Example responses

204 Response

{}

Responses

Status Meaning Description
204 No Content Successfully updated channels
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized

Response Schema

Status Code 204

Successfully updated channels

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Customers

Get a specific customer

Code samples

GET https://omni.mmdsmart.com/api/customers/{identifier} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/customers/{identifier}

Retrieve specific customer by ID or by phone number.

Parameters

Name In Type Required Description
identifier path any true Customer ID (_id) or phone number (phone)
Authorization header string true User token used for authorization

Example responses

200 Response

{
"customer": {
"_id": "4762e0fe-1780-bac2-dccf-b03fc9409a1d",
"name": "John Smith",
"phone": "145044111206",
"country": "USA",
"subscriptions": {
"a348d8d2-9114-a701-f6bb-4169aa2a1423": true,
"1fca5756-0529-4031-b02f-eab4576a3598": true
},
"chatbot_enabled": {
"b348d8d2-9114-a701-f6bb-4169aa2a1423": "ENABLED_MANUALLY",
"0fca5756-0529-4031-b02f-eab4576a3598": "DISABLED_AUTO"
},
"created": "2020-07-01T13:22:05.409Z",
"modified": "2020-07-01T13:22:05.409Z",
"last_message_time": "2020-07-01T13:22:05.409Z"
}
}

Responses

Status Meaning Description
200 OK Successfully returned customer
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Successfully returned customer

Name Type Description
» customer object Customer object. Customer is a person with whom user communicates in a chat
»» _id string(uuid) Customer ID in database
»» chatbot_enabled object Whether chatbot is enabled for conversations with current customer
»» phone string Customer mobile phone number
»» name string Customer name
»» country string Customer country
»» telegram_chat_id string Current customer Telegram chat ID
»» subscriptions object Agent IDs which the customer was subscribed or unsubscribed from.
»» created string(date-time) Customer creating timestamp
»» modified string(date-time) Customer updating timestamp
»» last_message_time string(date-time) Customer last message (sent or received) timestamp
»» chatbot_notification_received object Channel IDs in which the user has notification from customer.

Enumerated Values

country: AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BG BH BI BJ BL BM BN BO BS BT BV BY BZ CC CD CF CG CH CK CM CN CU CV CW CX CY CZ DE DJ DK DM DO DZ EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GG GH GI GL GM GN GP GQ GR GS GU GW GY HK HM HR HT HU ID IE IL IM IO IQ IR IS JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MY MZ NA NC NE NF NL NO NP NR NU NZ OM PF PG PK PM PN PS PT PW QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SO SR SS ST SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW BW BR BF CA CL CO CR EC SV FR GT HN IN CI IT MX NI NG PA PY PE PL PH PR SN ES GB UY US

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get all customers

Code samples

GET https://omni.mmdsmart.com/api/customers HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/customers

Retrieve all customers for current user.

Parameters

Name In Type Required Description
offset query number false Sets the first position to return from the results of the request. Default - 0
limit query number false The number of entities to return in result. Default - 50
sort query string false The field by which entities in result are sorted. Default - created
order query number false Direction of entities sorting - ascending (1) or descending (-1). Default - 1
search query string false The field by which entities in result are searched
name query string false Could be used to filter customers by name field
phone query string false Could be used to filter customers by phone field
Authorization header string true User token used for authorization

Enumerated Values

order: -1 1

Example responses

200 Response

{
"customers": [
{
"_id": "4762e0fe-1780-bac2-dccf-b03fc9409a1d",
"name": "John Smith",
"phone": "145044111206",
"country": "US",
"subscriptions": {
"a348d8d2-9114-a701-f6bb-4169aa2a1423": true,
"1fca5756-0529-4031-b02f-eab4576a3598": true
},
"chatbot_enabled": {
"b348d8d2-9114-a701-f6bb-4169aa2a1423": "ENABLED_MANUALLY",
"0fca5756-0529-4031-b02f-eab4576a3598": "DISABLED_AUTO"
},
"created": "2020-07-01T13:22:05.409Z",
"modified": "2020-07-01T13:22:05.409Z",
"last_message_time": "2020-07-01T13:22:05.409Z"
}
],
"total": 1,
"limit": 50,
"offset": 0
}

Responses

Status Meaning Description
200 OK Successfully returned customers
401 Unauthorized Unauthorized

Response Schema

Status Code 200

Successfully returned customers

Name Type Description
» customers [object] Successfully returned customers
»» _id string(uuid) Customer ID in database
»» chatbot_enabled object Whether chatbot is enabled for conversations with current customer
»» phone string Customer mobile phone number
»» name string Customer name
»» country string Customer country
»» telegram_chat_id string Current customer Telegram chat ID
»» subscriptions object Agent IDs which the customer was subscribed or unsubscribed from.
»» created string(date-time) Customer creating timestamp
»» modified string(date-time) Customer updating timestamp
»» last_message_time string(date-time) Customer last message (sent or received) timestamp
»» chatbot_notification_received object Channel IDs in which the user has notification from customer.
» total number Total amount of entities for current user
» offset number Sets the first position to return from the results of the request. Default - 0
» limit number The number of entities to return in result. Default - 50

Enumerated Values

country: AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BG BH BI BJ BL BM BN BO BS BT BV BY BZ CC CD CF CG CH CK CM CN CU CV CW CX CY CZ DE DJ DK DM DO DZ EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GG GH GI GL GM GN GP GQ GR GS GU GW GY HK HM HR HT HU ID IE IL IM IO IQ IR IS JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MY MZ NA NC NE NF NL NO NP NR NU NZ OM PF PG PK PM PN PS PT PW QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SO SR SS ST SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW BW BR BF CA CL CO CR EC SV FR GT HN IN CI IT MX NI NG PA PY PE PL PH PR SN ES GB UY US

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Create a customer

Code samples

POST https://omni.mmdsmart.com/api/customers HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/customers

Create a new customer for current user.

Body parameter

{
"phone": "145044111206",
"name": "John Smith"
}

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization
phone body string true Customer mobile phone number
name body string false Customer name

Example responses

201 Response

{
"success": true,
"customer": {
"_id": "4762e0fe-1780-bac2-dccf-b03fc9409a1d",
"name": "John Smith",
"phone": "145044111206",
"country": "US",
"subscriptions": {
"b348d8d2-9114-a701-f6bb-4169aa2a1423": true,
"4762e0fe-9114-a701-f6bb-4169aa2a1423": false
},
"chatbot_enabled": {
"b348d8d2-9114-a701-f6bb-4169aa2a1423": "ENABLED_MANUALLY"
},
"created": "2020-07-01T13:22:05.409Z",
"modified": "2020-07-01T13:22:05.409Z",
"last_message_time": "2020-07-01T13:22:05.409Z"
}
}

Responses

Status Meaning Description
201 Created Successfully created a customer
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
409 Conflict Conflict

Response Schema

Status Code 201

Successfully created a customer

Name Type Description
» success boolean
» customer object Customer object. Customer is a person with whom user communicates in a chat
»» _id string(uuid) Customer ID in database
»» chatbot_enabled object Whether chatbot is enabled for conversations with current customer
»» phone string Customer mobile phone number
»» name string Customer name
»» country string Customer country
»» telegram_chat_id string Current customer Telegram chat ID
»» subscriptions object Agent IDs which the customer was subscribed or unsubscribed from.
»» created string(date-time) Customer creating timestamp
»» modified string(date-time) Customer updating timestamp
»» last_message_time string(date-time) Customer last message (sent or received) timestamp
»» chatbot_notification_received object Channel IDs in which the user has notification from customer.

Enumerated Values

country: AD AE AF AG AI AL AM AO AQ AR AS AT AU AW AX AZ BA BB BD BE BG BH BI BJ BL BM BN BO BS BT BV BY BZ CC CD CF CG CH CK CM CN CU CV CW CX CY CZ DE DJ DK DM DO DZ EE EG EH ER ET FI FJ FK FM FO GA GD GE GF GG GH GI GL GM GN GP GQ GR GS GU GW GY HK HM HR HT HU ID IE IL IM IO IQ IR IS JE JM JO JP KE KG KH KI KM KN KP KR KW KY KZ LA LB LC LI LK LR LS LT LU LV LY MA MC MD ME MF MG MH MK ML MM MN MO MP MQ MR MS MT MU MV MW MY MZ NA NC NE NF NL NO NP NR NU NZ OM PF PG PK PM PN PS PT PW QA RE RO RS RU RW SA SB SC SD SE SG SH SI SJ SK SL SM SO SR SS ST SX SY SZ TC TD TF TG TH TJ TK TL TM TN TO TR TT TV TW TZ UA UG UZ VA VC VE VG VI VN VU WF WS XK YE YT ZA ZM ZW BW BR BF CA CL CO CR EC SV FR GT HN IN CI IT MX NI NG PA PY PE PL PH PR SN ES GB UY US

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 409

Conflict

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Modify a specific customer

Code samples

PATCH https://omni.mmdsmart.com/api/customers/{customer_id} HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

PATCH /api/customers/{customer_id}

Modify a specific customer by ID.

Body parameter

{
"chatbot_enabled": {},
"name": "John Smith"
}

Parameters

Name In Type Required Description
customer_id path string(uuid) true Customer ID in database
Authorization header string true User token used for authorization
chatbot_enabled body object false Whether chatbot is enabled for conversations with current customer
name body string false Customer name

Example responses

204 Response

{}

Responses

Status Meaning Description
204 No Content Successfully updated customer
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found

Response Schema

Status Code 204

Successfully updated customer

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Delete a specific customer

Code samples

DELETE https://omni.mmdsmart.com/api/customers/{customer_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

DELETE /api/customers/{customer_id}

Remove a specific customer by ID.

Parameters

Name In Type Required Description
customer_id path string(uuid) true Customer ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{
"success": true
}

Responses

Status Meaning Description
200 OK Customer was successfully removed
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Customer was successfully removed

Name Type Description
» success boolean Whether the request was successfully processed

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Keyword Events

Get all keyword events

Code samples

GET https://omni.mmdsmart.com/api/keyword_events HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/keyword_events

Retrieve all keyword events for current user.

Parameters

Name In Type Required Description
offset query number false Sets the first position to return from the results of the request. Default - 0
limit query number false The number of entities to return in result. Default - 50
sort query string false The field by which entities in result are sorted. Default - created
order query number false Direction of entities sorting - ascending (1) or descending (-1). Default - 1
search query string false The field by which entities in result are searched
Authorization header string true User token used for authorization

Enumerated Values

order: -1 1

Example responses

200 Response

{
"keyword_events": [
{
"_id": "60126d04-fd92-c822-1aa7-5dbf7b34db41",
"keywords": [
"join",
"enter"
],
"config": {
"type": "Join",
"message": "You've joined our club"
}
}
],
"total": 1,
"limit": 50,
"offset": 0
}

Responses

Status Meaning Description
200 OK Events list

Response Schema

Status Code 200

Events list

Name Type Description
» keyword_events [object] Successfully returned keyword events
»» _id string(uuid) Keyword event ID in database
»» keywords [string] List of words that trigger specific keyword event
»» config object Keyword event config
»»» type string Keyword event type
»»» message string Message that would be sent to customer after keyword event triggering (only for JOIN keyword event. Messages for events of other types are set in channel entity, separately for each channel)
» total number Total amount of entities for current user
» offset number Sets the first position to return from the results of the request. Default - 0
» limit number The number of entities to return in result. Default - 50

Enumerated Values

type: OPT_OUT JOIN HELP

Create a keyword event

Code samples

POST https://omni.mmdsmart.com/api/keyword_events HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/keyword_events

Create a new keyword event for current user.

Body parameter

{
"event": "Join",
"keywords": [
"join",
"enter"
],
"message": "You've joined our club"
}

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization
event body string true Keyword event type
keywords body [string] true List of words that trigger specific keyword event
message body string false Message that would be sent to customer after keyword event triggering (only for JOIN keyword event. Messages for events of other types are set in channel entity, separately for each channel)

Enumerated Values

event: Opt-out Join Help

Example responses

201 Response

{
"keyword_event": {
"_id": "60126d04-fd92-c822-1aa7-5dbf7b34db41",
"keywords": [
"join",
"enter"
],
"config": {
"type": "Join",
"message": "You've joined our club"
}
}
}

Responses

Status Meaning Description
201 Created Successfully created a keyword event
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
409 Conflict Conflict

Response Schema

Status Code 201

Successfully created a keyword event

Name Type Description
» keyword_event object Keyword event object. After triggering OPT_OUT keyword event you have no ability to chat with the client until he sends any message again
»» _id string(uuid) Keyword event ID in database
»» keywords [string] List of words that trigger specific keyword event
»» config object Keyword event config
»»» type string Keyword event type
»»» message string Message that would be sent to customer after keyword event triggering (only for JOIN keyword event. Messages for events of other types are set in channel entity, separately for each channel)

Enumerated Values

type: OPT_OUT JOIN HELP

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 409

Conflict

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get a specific keyword event

Code samples

GET https://omni.mmdsmart.com/api/keyword_events/{event_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/keyword_events/{event_id}

Retrieve a specific keyword event by ID.

Parameters

Name In Type Required Description
event_id path string(uuid) true Keyword event ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{
"keyword_event": {
"_id": "60126d04-fd92-c822-1aa7-5dbf7b34db41",
"keywords": [
"join",
"enter"
],
"config": {
"type": "Join",
"message": "You've joined our club"
}
}
}

Responses

Status Meaning Description
200 OK Successfully returned keyword event
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Successfully returned keyword event

Name Type Description
» keyword_event object Keyword event object. After triggering OPT_OUT keyword event you have no ability to chat with the client until he sends any message again
»» _id string(uuid) Keyword event ID in database
»» keywords [string] List of words that trigger specific keyword event
»» config object Keyword event config
»»» type string Keyword event type
»»» message string Message that would be sent to customer after keyword event triggering (only for JOIN keyword event. Messages for events of other types are set in channel entity, separately for each channel)

Enumerated Values

type: OPT_OUT JOIN HELP

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Modify a keyword event

Code samples

PATCH https://omni.mmdsmart.com/api/keyword_events/{event_id} HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

PATCH /api/keyword_events/{event_id}

Modifies a specific keyword event by ID.

Body parameter

{
"keywords": [
"join",
"enter"
],
"message": "You've joined our club"
}

Parameters

Name In Type Required Description
event_id path string(uuid) true Keyword event ID in database
Authorization header string true User token used for authorization
keywords body [string] false List of words that trigger specific keyword event
message body string false Message that would be sent to customer after keyword event triggering (only for JOIN keyword event. Messages for events of other types are set in channel entity, separately for each channel)

Example responses

204 Response

{}

Responses

Status Meaning Description
204 No Content Successfully updated keyword event
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 204

Successfully updated keyword event

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Delete a specific keyword event

Code samples

DELETE https://omni.mmdsmart.com/api/keyword_events/{event_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

DELETE /api/keyword_events/{event_id}

Remove a specific keyword event by ID.

Parameters

Name In Type Required Description
event_id path string(uuid) true Keyword event ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{}

Responses

Status Meaning Description
200 OK Keyword event was successfully removed
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Keyword event was successfully removed

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Links

Code samples

POST https://omni.mmdsmart.com/api/links/shorten HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/links/shorten

Shortens a given links list using ShortLink service for some particular customer of this user. Relation group user+customer+link would be needed to keep click statistics. So both customerNumber and links fields are mandatory.

Body parameter

{
"customerNumber": "3809861675507",
"links": [
"https://www.youtube.com/watch?v=X48VuDVv0do",
"https://www.youtube.com/watch?v=cgVVZMfLjEI"
]
}
Name In Type Required Description
Authorization header string true User token used for authorization
customerNumber body string true Customer mobile phone number
links body [string] true List of links that will be shortened

Example responses

200 Response

{
"links": [
{
"base": "https://www.youtube.com/watch?v=X48VuDVv0do",
"short": "http://x4p.me/Sw5Tp"
}
]
}
Status Meaning Description
200 OK Links were successfully shortened
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
406 Not Acceptable Not Acceptable

Status Code 200

Links were successfully shortened

Name Type Description
» links [object] Base and short links
»» base string Base link
»» short string Short link

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 406

Not Acceptable

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Code samples

GET https://omni.mmdsmart.com/api/links/tokens HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/links/tokens

Returns a list of link tokens that can be used in your outgoing text messages: Hi, John! Could you please check this out: {{link:146746}}

Name In Type Required Description
Authorization header string true User token used for authorization

Example responses

200 Response

{
"links": [
{
"enabled": true,
"id": 146746,
"name": "Watch this",
"url": "https://www.youtube.com/watch?v=X48VuDVv0do"
}
],
"total": 1
}
Status Meaning Description
200 OK Link tokens list
401 Unauthorized Unauthorized

Status Code 200

Link tokens list

Name Type Description
» links [object] Successfully returned links list
»» enabled boolean Whether link is enabled
»» id number Link ID
»» name string Link name
»» url string Link base URL
» total number Total amount of entities for current user

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Media gallery

Code samples

GET https://omni.mmdsmart.com/api/media HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/media

Retrieve media files uploaded by the user.

Name In Type Required Description
offset query number false Sets the first position to return from the results of the request. Default - 0
limit query number false The number of entities to return in result. Default - 50
type query string false Allowed media types
Authorization header string true User token used for authorization

Enumerated Values

type: image video file

Example responses

200 Response

{
"media": [
{
"_id": "ef9ada80-10ad-4e68-90cf-b050db455117",
"type": "image",
"mime_type": "image/jpeg",
"full_size": 14359,
"url": "https://omni.mmdsmart.com/api/media/ef9ada80-10ad-4e68-90cf-b050db455117",
"thumbnail": "https://omni.mmdsmart.com/api/media/ef9ada80-10ad-4e68-90cf-b050db455117/thumbnail",
"preview": "https://omni.mmdsmart.com/api/media/ef9ada80-10ad-4e68-90cf-b050db455117/preview"
}
],
"total": 1,
"limit": 50,
"offset": 0
}
Status Meaning Description
200 OK Media files list
401 Unauthorized Unauthorized

Status Code 200

Media files list

Name Type Description
» media [object] Media object
»» _id string Media object ID in storage
»» type string Media type
»» mime_type string Media mime type
»» full_size number Media size in bytes (max size 50 MB)
»» file_name string Media file name (optional)
»» url string(uri) URL to get media file
»» thumbnail string(uri) URL to get media file thumbnail (400×400 px)
»» preview string(uri) URL to get media file preview (160×160 px)
» total number Total amount of entities for current user
» offset number Sets the first position to return from the results of the request. Default - 0
» limit number The number of entities to return in result. Default - 50

Enumerated Values

type: image video file

mime_type: image/png image/jpeg image/jpg image/gif image/svg+xml image/svg video/mp4 video/m4v video/mpeg video/h263 video/mpeg4 video/webm video/ogg video/3gpp application/x-zip-compressed application/zip application/pdf application/xml application/vnd.ms-excel application/vnd.ms-powerpoint application/msword application/ogg application/xhtml+xml application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.openxmlformats-officedocument.presentationml.presentation audio/aac audio/x-aac audio/ogg audio/mp3 audio/mpeg text/html text/csv text/xml image/webp application/octet-stream

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Upload a media file

Code samples

POST https://omni.mmdsmart.com/api/media HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json

POST /api/media

Upload a media file using multipart/form-data.

Parameters

Name In Type Required Description
messageID query string false The message media file corresponds to

Example responses

200 Response

{
"_id": "string",
"type": "image",
"mime_type": "image/png",
"full_size": 14359,
"file_name": "string",
"url": "https://omni.mmdsmart.com/api/media/ef9ada80-10ad-4e68-90cf-b050db455117",
"thumbnail": "https://omni.mmdsmart.com/api/media/ef9ada80-10ad-4e68-90cf-b050db455117/thumbnail",
"preview": "https://omni.mmdsmart.com/api/media/ef9ada80-10ad-4e68-90cf-b050db455117/preview"
}

Responses

Status Meaning Description
200 OK File was uploaded successfully
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized

Response Schema

Status Code 200

File was uploaded successfully

Name Type Description
» _id string Media object ID in storage
» type string Media type
» mime_type string Media mime type
» full_size number Media size in bytes (max size 50 MB)
» file_name string Media file name (optional)
» url string(uri) URL to get media file
» thumbnail string(uri) URL to get media file thumbnail (400×400 px)
» preview string(uri) URL to get media file preview (160×160 px)

Enumerated Values

type: image video file

mime_type: image/png image/jpeg image/jpg image/gif image/svg+xml image/svg video/mp4 video/m4v video/mpeg video/h263 video/mpeg4 video/webm video/ogg video/3gpp application/x-zip-compressed application/zip application/pdf application/xml application/vnd.ms-excel application/vnd.ms-powerpoint application/msword application/ogg application/xhtml+xml application/vnd.openxmlformats-officedocument.spreadsheetml.sheet application/vnd.openxmlformats-officedocument.wordprocessingml.document application/vnd.openxmlformats-officedocument.presentationml.presentation audio/aac audio/x-aac audio/ogg audio/mp3 audio/mpeg text/html text/csv text/xml image/webp application/octet-stream

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Delete a media file

Code samples

DELETE https://omni.mmdsmart.com/api/media?media_ids=497f6eca-6276-4993-bfeb-53cbbbba6f08 HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

DELETE /api/media

Permanently delete a file with its thumbnail and preview if applicable. This action cannot be undone.

Parameters

Name In Type Required Description
media_ids query array[string] true Media files IDs to delete
Authorization header string true User token used for authorization

Example responses

200 Response

{}

Responses

Status Meaning Description
200 OK Files was successfully deleted
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found

Response Schema

Status Code 200

Files was successfully deleted

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get a media file

Code samples

GET https://omni.mmdsmart.com/api/media/{enterprise_id}/{media_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json

GET /api/media/{enterprise_id}/{media_id}

Retrieve a specific media file by identifier (customer ID or phone number)

Parameters

Name In Type Required Description
media_id path string(uuid) true Media object ID
enterprise_id path string(uuid) true User enterprise ID

Example responses

200 Response

{}

Responses

Status Meaning Description
200 OK A specific media file
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found

Response Schema

Status Code 200

A specific media file

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get a media file preview or thumbnail

Code samples

GET https://omni.mmdsmart.com/api/media/{enterprise_id}/{media_id}/{size_type} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json

GET /api/media/{enterprise_id}/{media_id}/{size_type}

Retrieve a media file’s preview image (160×160 px), or its thumbnail image (400x400 px) if applicable.

Parameters

Name In Type Required Description
media_id path string(uuid) true Media object ID
enterprise_id path string(uuid) true User enterprise ID
size_type path string true Media size type

Enumerated Values

size_type: preview thumbnail

Example responses

200 Response

{}

Responses

Status Meaning Description
200 OK File preview/thumbnail itself
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found

Response Schema

Status Code 200

File preview/thumbnail itself

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Messages

Get customer messaging history

Code samples

GET https://omni.mmdsmart.com/api/messages/{identifier} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/messages/{identifier}

Retrieve customer’s messaging history.

Parameters

Name In Type Required Description
offset query number false Sets the first position to return from the results of the request. Default - 0
limit query number false The number of entities to return in result. Default - 50
sort query string false Field to order the results. Default - sent
order query number false Direction of sorting - ascending (1) or descending (-1). Default - -1
agentID query string false Retrieve messages corresponding to the provided agent
origin query string false Retrieve messages corresponding to the provided origin
identifier path any true Customer ID or a phone number
Authorization header string true User token used for authorization

Enumerated Values

order: -1 1

origin: BOT AGENT CUSTOMER BROADCAST

Example responses

200 Response

{
"messages": [
{
"customer_id": "6de4fc8d-84c7-c6ee-6ee0-fe05c37612a0",
"message_id": "ef9ada80-10ad-4e68-90cf-b050db455117",
"agent_id": "bf03f2d3-645d-4d5c-a70e-a0f195fbba46",
"payload": {
"type": "TEXT",
"text": "hi"
},
"origin": "AGENT",
"sent": "2020-11-18T15:11:58.240Z",
"status": "READ"
}
],
"total": 1,
"limit": 50,
"offset": 0
}

Responses

Status Meaning Description
200 OK Customer’s Messaging History
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Customer’s Messaging History

Name Type Description
» messages [object] List of messages
»» agent_id string(uuid) Agent ID of current message channel
»» customer_id string(uuid) Customer ID of current message
»» message_id string(uuid) Message ID in database
»» payload object Message payload
»» origin string Entity that created a message
»» sent string(date-time) Message sent timestamp
»» created string(date-time) Message creating timestamp
»» modified string(date-time) Message updating timestamp
»» status string Message status
» total number Total amount of entities for current user
» offset number Sets the first position to return from the results of the request. Default - 0
» limit number The number of entities to return in result. Default - 50

Enumerated Values

origin: BOT AGENT CUSTOMER BROADCAST

status: SENT DELIVERED READ ERROR UNDELIVERABLE CREATED UPLOAD_ERROR

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Delete message

Code samples

DELETE https://omni.mmdsmart.com/api/messages/{messageID} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

DELETE /api/messages/{messageID}

Delete message by id.

Parameters

Name In Type Required Description
messageID path string(uuid) true Message ID
Authorization header string true User token used for authorization

Example responses

204 Response

{}

Responses

Status Meaning Description
204 No Content Message was successfully deleted
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found

Response Schema

Status Code 204

Message was successfully deleted

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

RCS

Send RCS message

Code samples

POST https://omni.mmdsmart.com/api/agents/rcs/{agent_id}/send HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/agents/rcs/{agent_id}/send

Body parameter

{
"customerNumber": "145044111206",
"payload": {
"type": "TEXT",
"text": "Hello world"
}
}

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization
customerNumber body string true Mobile phone to send message
payload body any true RCS message payload
<—> <—> <—> <—> Text message payload
»» type body string true Message type
»» text body string true Message text
<—> <—> <—> <—> Media file message payload
»» type body any true Message type
»» category body string true Media file category
»» name body string false Media file name(optional)
»» src body object true Media file full size data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» thumbnail body object false Media file thumbnail data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» preview body object false Media file preview data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
<—> <—> <—> <—> Image file message payload
»» type body any true Message type
»» category body string true Image file category
»» name body string false Image file name(optional)
»» src body object true Image file full size data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» thumbnail body object true Image file thumbnail data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» preview body object true Image file preview data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
<—> <—> <—> <—> Carousel message payload
»» type body any true Message type
»» width body string true Carousel width
»» content body [object] true Carousel content
»»» type body any true Message type
»»» orientation body string false Card orientation
»»» align body string false Card alignment
»»» title body string true Card title
»»» description body string true Card description
»»» text body string false Card text
»»» namespace body string false Card namespace
»»» language_code body string false Card language code
»»» media body any false
<—> <—> <—> <—> Card media data
»»»»» tag body string true Card tag
»»»»» height body string false Card height
»»»»» src body object true Full size media data
»»»»»» mime body string true Media file mime
»»»»»» size body number true Media file size in bytes
»»»»»» uri body string true Media file URL
»»»»» thumbnail body object true Media thumbnail data
»»»»»» mime body string true Media file mime
»»»»»» size body number true Media file size in bytes
»»»»»» uri body string true Media file URL
<—> <—> <—> <—> Card media data
»»»»» tag body string true Card tag
»»»»» height body string false Card height
»»»»» src body object true Full size media data
»»»»»» mime body string true Media file mime
»»»»»» size body number true Media file size in bytes
»»»»»» uri body string true Media file URL
»»» suggestions body [object] true Choice options of card
»»»» reply body object true Contains text
»»»»» text body string true Text that will sent from customer after he chooses an option
<—> <—> <—> <—> Template message payload
»» template_id body string true Message template id

Enumerated Values

»» category: VIDEO AUDIO VOICE APPLICATION UNSPECIFIED

»» width: CARD_WIDTH_UNSPECIFIED SMALL MEDIUM

»»» orientation: CARD_ORIENTATION_UNSPECIFIED VERTICAL HORIZONTAL

»»» align: THUMBNAIL_IMAGE_ALIGNMENT_UNSPECIFIED LEFT RIGHT

»»»»» height: SHORT MEDIUM TALL

Example responses

200 Response

{
"message_id": "1a45bd2c-f94d-4e80-a335-5856b3f232f7"
}

Responses

Status Meaning Description
200 OK Message was sent successfully
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Message was sent successfully

Name Type Description
» message_id string(uuid) Message ID in database

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Settings

Get 2way communication settings

Code samples

GET https://omni.mmdsmart.com/api/settings HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/settings

Retrieves 2 way communication settings for the user.

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization

Example responses

200 Response

{
"short_links_generation_enabled": true,
"chatbot_settings": {
"OWN": {
"is_enabled": false
},
"CHATBOT_COM": {
"is_enabled": true,
"access_token": "xKmN3jAXu7ssMjdFsU5Cf1hY_29nxeUa"
},
"DIALOGFLOW": {
"is_enabled": true,
"credentials": {
"type": "service_account",
"project_id": "dialog-flow-test-1337",
"private_key_id": "415956475d20f",
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEABoIBAQCpw2hMP/ll/kU4\nT3yYsLmIHsix917i2N2+f/hdS0V4A/1pF8qm2nToEuj1UzGX9afgccJzqIrDwCHd\nOhDlc8KR8PyQiflNVy5o4NC9PrcCRiOzNFkYVnv0MCHuRp/NTvPf2JjauPyetbMD\nLDVAfGTbEoYF6RGoeC/gWaemjCOUc8nqOHXMXEIZoomy7Ogf96QBCIyEmhKrS1vD\nNvYA6UPUw1u/5OhUMZGNujA57N1T+aPx6JCvaMIPs0khLwGTUvLJfTgKP8eNrjvq\nQgvLP+IrxI1Rf31domiHP2ZIXnZ4RLZ7BknUyWaw6cGDwYa5cgPI0idihSMLlp8q\nIRgQppRfAgMBAAECggEACeaVw8isChjrvuPSikctnYo0veha635RZGWrPamrqgW1\njEuxFnfBf11xol576HcRF45wPvWSmOWw3pRJ3aVEMOXDR8dm4kNWN2imfpBUn7h+\nfC+ZOJ7781sGnOfCic3z0YIc3A4ThvVliib/DhKTK+b8fltq8Q6ICvIU9yok0xNb\nQ+NG81UwGet0nAHkq9XdxrOoM6UwrBeVHDDPhh2zkW1XxfjYDsKlqFwjqYcCqkWt\nTreH7uS5XXdeQkT94kkX+LD0LaIVdpn/tEOVj0TXWvD1q68zJZFol7Lw+V96jcPF\nojQ1gvxXAvDNkpnFoTSaUz3BS6LmbEwmqXltGFxJsQKBgQDlBrnF6lCul2frWjKE\nmKmjiBNvmOv69BaZDSmB6HO6grPdAUHefS/v5TVQw5smrUBNcy0IFcuZJzMwTD6T\nLGwXPb1/2m7GY9oASvW6Zah/Mtnk8BZIRf8TRIPDZKKOeUv6JxvMydTIk8Vy9Q7G\nWPEfY6IuiOaVL5\n-----END PRIVATE KEY-----\n",
"client_email": "admin-1337@dialog-flow-ccount.com",
"client_id": "1002153959566",
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
"token_uri": "https://oauth2.googleapis.com/token",
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/admin-1337%40dialog-flow-test-1337.iam.gserviceaccount.com"
}
}
},
"notification_settings": {}
}

Responses

Status Meaning Description
200 OK Retrieve settings data
401 Unauthorized Unauthorized

Response Schema

Status Code 200

Retrieve settings data

Name Type Description
» short_links_generation_enabled boolean Whether all long links in text messages should be processed by ShortLink
» notification_settings object Notifications settings
» chatbot_settings object Chatbot settings
»» OWN object Own chatbot settings
»»» is_enabled boolean
»» CHATBOT_COM object Chatbot.com chatbot settings
»»» is_enabled boolean
»»» access_token string Access token of chatbot.com service
»» DIALOGFLOW object Dialogflow chatbot settings
»»» is_enabled boolean
»»» credentials object¦null Dialogflow chatbot settings credentials
»»»» type string
»»»» project_id string
»»»» private_key_id string
»»»» private_key string
»»»» client_email string
»»»» client_id string
»»»» auth_uri string
»»»» token_uri string
»»»» auth_provider_x509_cert_url string
»»»» client_x509_cert_url string

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Modify 2way communication settings

Code samples

PATCH https://omni.mmdsmart.com/api/settings HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

PATCH /api/settings

Modifies one or more settings. Any previous settings which are not specified will not be modified by this request.

If chatbot_settings[ORIGIN].is_enabled is false, other fields of chatbot_settings properties sub-object aren’t required. Otherwise, all fields are required (is_enabled, access_token).

Body parameter

{
"short_links_generation_enabled": true,
"notification_settings": {},
"chatbot_settings": {
"OWN": {
"is_enabled": true
},
"CHATBOT_COM": {
"is_enabled": true,
"access_token": "xKmN3jAXu7ssMjdFsU5Cf1hY_29nxeUa"
},
"DIALOGFLOW": {
"is_enabled": true,
"credentials": {
"type": "string",
"project_id": "string",
"private_key_id": "string",
"private_key": "string",
"client_email": "string",
"client_id": "string",
"auth_uri": "string",
"token_uri": "string",
"auth_provider_x509_cert_url": "string",
"client_x509_cert_url": "string"
}
}
}
}

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization
short_links_generation_enabled body boolean false Whether all long links in text messages should be processed by ShortLink
notification_settings body object false Notifications settings
chatbot_settings body object false Chatbot settings
» OWN body object false Own chatbot settings
»» is_enabled body boolean true
» CHATBOT_COM body object false Chatbot.com chatbot settings
»» is_enabled body boolean true
»» access_token body string false Access token of chatbot.com service
» DIALOGFLOW body object false Dialogflow chatbot settings
»» is_enabled body boolean true
»» credentials body object¦null true Dialogflow chatbot settings credentials
»»» type body string true
»»» project_id body string true
»»» private_key_id body string true
»»» private_key body string true
»»» client_email body string true
»»» client_id body string true
»»» auth_uri body string true
»»» token_uri body string true
»»» auth_provider_x509_cert_url body string true
»»» client_x509_cert_url body string true

Example responses

204 Response

{}

Responses

Status Meaning Description
204 No Content Settings modified successfully
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized

Response Schema

Status Code 204

Settings modified successfully

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

SMS

Send SMS message

Code samples

POST https://omni.mmdsmart.com/api/agents/sms/{agent_id}/send HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/agents/sms/{agent_id}/send

Body parameter

{
"customerNumber": "145044111206",
"payload": {
"type": "TEXT",
"text": "Hello world"
}
}

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization
customerNumber body string true Mobile phone to send message
payload body object true Text message payload
» type body string true Message type
» text body string true Message text

Example responses

200 Response

{
"message_id": "1a45bd2c-f94d-4e80-a335-5856b3f232f7"
}

Responses

Status Meaning Description
200 OK Message was sent successfully
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Message was sent successfully

Name Type Description
» message_id string(uuid) Message ID in database

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Telegram

Send Telegram message

Code samples

POST https://omni.mmdsmart.com/api/agents/telegram/{agent_id}/send HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/agents/telegram/{agent_id}/send

Body parameter

{
"customerNumber": "145044111206",
"payload": {
"type": "TEXT",
"text": "Hello world"
}
}

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization
customerNumber body string true Mobile phone to send message
payload body any true Telegram message payload
<—> <—> <—> <—> Text message payload
»» type body string true Message type
»» text body string true Message text
<—> <—> <—> <—> Media file message payload
»» type body any true Message type
»» category body string true Media file category
»» name body string false Media file name(optional)
»» src body object true Media file full size data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» thumbnail body object false Media file thumbnail data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» preview body object false Media file preview data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
<—> <—> <—> <—> Image file message payload
»» type body any true Message type
»» category body string true Image file category
»» name body string false Image file name(optional)
»» src body object true Image file full size data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» thumbnail body object true Image file thumbnail data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» preview body object true Image file preview data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
<—> <—> <—> <—> Location message payload
»» type body any true Message type
»» latitude body number true Location latitude
»» longitude body number true Location longitude
<—> <—> <—> <—> Contact message payload
»» type body any true Message type
»» firstname body string true Contact first name
»» lastname body string true Contact last name
»» phone body string true Contact mobile phone number
»» email body string(email) false Contact email address
»» country body string false Contact country
»» country_code body string false Contact country code
»» city body string false Contact city
»» street body string false Contact street
»» birthday body string false Contact birthday
<—> <—> <—> <—> Template message payload
»» template_id body string true Message template id

Enumerated Values

»» category: VIDEO AUDIO VOICE APPLICATION UNSPECIFIED

Example responses

200 Response

{
"message_id": "1a45bd2c-f94d-4e80-a335-5856b3f232f7"
}

Responses

Status Meaning Description
200 OK Message was sent successfully
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Message was sent successfully

Name Type Description
» message_id string(uuid) Message ID in database

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Configure an agent

Code samples

PATCH https://omni.mmdsmart.com/api/agents/telegram/{agent_id} HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json

PATCH /api/agents/telegram/{agent_id}

Modifies agent’s configuration by ID.

Body parameter

{
"status": "ACTIVE",
"config": {
"bot_name": "Bot of bots",
"access_token": "1827085009:AAGcSqLyPTdmnNmWL4-mdsdsdkYNlYyFrU"
}
}

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
status body string true Agent status
config body object true Agent config
» bot_name body string true Bot name
» access_token body string true Bot access token

Enumerated Values

status: ACTIVE ON_APPROVAL HOLD

Example responses

200 Response

{
"success": true
}

Responses

Status Meaning Description
200 OK Successfully patched
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Successfully patched

Name Type Description
» success any Whether the request was successfully processed

oneOf

Name Type Description
boolean

xor

Name Type Description
string

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Viber

Send Viber message

Code samples

POST https://omni.mmdsmart.com/api/agents/viber/{agent_id}/send HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/agents/viber/{agent_id}/send

Body parameter

{
"customerNumber": "145044111206",
"payload": {
"type": "TEXT",
"text": "Hello world"
}
}

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization
customerNumber body string true Mobile phone to send message
payload body any true Viber message payload
<—> <—> <—> <—> Text message payload
»» type body string true Message type
»» text body string true Message text
<—> <—> <—> <—> Image file message payload
»» type body any true Message type
»» category body string true Image file category
»» name body string false Image file name(optional)
»» src body object true Image file full size data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» thumbnail body object true Image file thumbnail data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» preview body object true Image file preview data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL

Example responses

200 Response

{
"message_id": "1a45bd2c-f94d-4e80-a335-5856b3f232f7"
}

Responses

Status Meaning Description
200 OK Message was sent successfully
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Message was sent successfully

Name Type Description
» message_id string(uuid) Message ID in database

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

WhatsApp

Send WhatsApp message

Code samples

POST https://omni.mmdsmart.com/api/agents/whatsapp/{agent_id}/send HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/agents/whatsapp/{agent_id}/send

Body parameter

{
"customerNumber": "145044111206",
"payload": {
"type": "TEXT",
"text": "Hello world"
}
}

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization
customerNumber body string true Mobile phone to send message
payload body any true WhatsApp message payload
<—> <—> <—> <—> Text message payload
»» type body string true Message type
»» text body string true Message text
<—> <—> <—> <—> Image file message payload
»» type body any true Message type
»» category body string true Image file category
»» name body string false Image file name(optional)
»» src body object true Image file full size data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» thumbnail body object true Image file thumbnail data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» preview body object true Image file preview data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
<—> <—> <—> <—> Media file message payload
»» type body any true Message type
»» category body string true Media file category
»» name body string false Media file name(optional)
»» src body object true Media file full size data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» thumbnail body object false Media file thumbnail data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
»» preview body object false Media file preview data
»»» mime body string true Media file mime
»»» size body number true Media file size in bytes
»»» uri body string true Media file URL
<—> <—> <—> <—> Location message payload
»» type body any true Message type
»» latitude body number true Location latitude
»» longitude body number true Location longitude
<—> <—> <—> <—> Contact message payload
»» type body any true Message type
»» firstname body string true Contact first name
»» lastname body string true Contact last name
»» phone body string true Contact mobile phone number
»» email body string(email) false Contact email address
»» country body string false Contact country
»» country_code body string false Contact country code
»» city body string false Contact city
»» street body string false Contact street
»» birthday body string false Contact birthday
<—> <—> <—> <—> Card message payload
»» type body any true Message type
»» template_id body string true WhatsApp template ID
»» body_variables body [string] false Template body variables array
»» header_variables body [string] false Template header variables array

Enumerated Values

»» category: VIDEO AUDIO VOICE APPLICATION UNSPECIFIED

Example responses

200 Response

{
"message_id": "1a45bd2c-f94d-4e80-a335-5856b3f232f7"
}

Responses

Status Meaning Description
200 OK Message was sent successfully
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Message was sent successfully

Name Type Description
» message_id string(uuid) Message ID in database

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get paginated WhatsApp templates

Code samples

GET https://omni.mmdsmart.com/api/agents/whatsapp/{agent_id}/templates HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/agents/whatsapp/{agent_id}/templates

Retrieve paginated WhatsApp templates for current user and agent.

Parameters

Name In Type Required Description
offset query number false Sets the first position to return from the results of the request. Default - 0
limit query number false The number of entities to return in result. Default - 50
sort query string false The field by which entities in result are sorted. Default - created
order query number false Direction of entities sorting - ascending (1) or descending (-1). Default - 1
search query string false The field by which entities in result are searched
status query string false Could be used to filter templates by status field
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization

Enumerated Values

order: -1 1

status: APPROVED IN_APPEAL PENDING REJECTED PENDING_DELETION DELETED DISABLED

Example responses

200 Response

{
"templates": [
{
"id": "493480348725846",
"category": "APPOINTMENT_UPDATE",
"status": "APPROVED",
"language": "af",
"name": "button_for_demo_1",
"preview": "some text",
"components": [
{
"type": "BODY",
"text": "some text"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "button 1"
},
{
"type": "QUICK_REPLY",
"text": "button 3"
}
]
}
]
},
{
"id": "408839324301065",
"category": "ALERT_UPDATE",
"status": "PENDING",
"language": "en",
"name": "test_all_dan",
"preview": "body",
"components": [
{
"type": "HEADER",
"format": "TEXT",
"text": "header"
},
{
"type": "BODY",
"text": "body"
},
{
"type": "FOOTER",
"text": "footer"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "PHONE_NUMBER",
"text": "phone",
"phone_number": "+380983917973"
},
{
"type": "URL",
"text": "site",
"url": "https://google.com/"
}
]
}
]
}
],
"total": 2,
"offset": 0,
"limit": 50
}

Responses

Status Meaning Description
200 OK WhatsApp templates
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
410 Gone Entity was removed
502 Bad Gateway Received an invalid response from the upstream server

Response Schema

Status Code 200

WhatsApp templates

Name Type Description
» templates [object] Successfully returned WhatsApp templates
»» id string FB template ID
»» category string FB template category
»» status string FB template status
»» language string FB template language
»» name string FB template name
»» body string FB template body
»» header object FB template header
»»» type string
»»» value string¦null
»» buttons object FB template buttons
»»» type string
»»» text string
»»» CTAOrder [any]
»»» phone object
»»»» text string
»»»» number string
»»» website object
»»»» text string
»»»» link string
»»» quickReplyBlocks [string]
»» footer string¦null FB template footer
» total number Total amount of entities for current user
» offset number Sets the first position to return from the results of the request. Default - 0
» limit number The number of entities to return in result. Default - 50

Enumerated Values

type: TEXT IMAGE VIDEO DOCUMENT NONE CTA QUICK_REPLY OTP

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 502

Received an invalid response from the upstream server

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Create WhatsApp template

Code samples

POST https://omni.mmdsmart.com/api/agents/whatsapp/{agent_id}/templates HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/agents/whatsapp/{agent_id}/templates

Create WhatsApp template for current user and agent.

Body parameter

{
"category": "MARKETING",
"language": "af",
"name": "Super template",
"body": "Hello world!",
"body_examples": [
"body_variable_example_1",
"body_variable_example_2"
],
"header_examples": [
"header_variable_example"
],
"header": {
"type": "TEXT",
"value": "Hello header!"
},
"buttons": {
"type": "CTA",
"phone": {
"number": "+145044111206",
"text": "CTA text"
},
"website": {
"link": "https://domain.com",
"text": "CTA text"
},
"quickReplyBlocks": [
"button_text_1",
"button_text_2"
],
"CTAOrder": [
[
"PHONE",
"WEBSITE"
]
]
},
"footer": "Beautiful footer"
}

Parameters

Name In Type Required Description
limit query number false The number of entities to return in result. Default - 50
order query number false Direction of entities sorting - ascending (1) or descending (-1). Default - 1
sort query string false The field by which entities in result are sorted. Default - created
search query string false The field by which entities in result are searched
returnMany query boolean false
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization
<—> <—> <—> <—> MARKETING and UTILITY payload
» category body string true Template category
» language body string true Template language
» name body string true Unique template name and also primary key
» body body string true Body text block for template
» body_examples body [string] false Examples for body variables
» header_examples body [string] false Examples for header variables
» header body object false Optional header block for template
»» type body string true Header type for template
»» value body string true Header value depends on its type
» buttons body object false Optional buttons block for template
»» type body string false Buttons type for template (“CTA” or “QUICK_REPLY”)
»» phone body object false Phone component for CTA button
»»» number body string true Phone number for CTA button
»»» text body string true Text for CTA button
»» website body object false Website component for CTA button
»»» link body string(uri) true Website link for CTA button
»»» text body string true Text for CTA button
»» quickReplyBlocks body [string] false Quick reply buttons texts
»» CTAOrder body [string] false Order of CTA buttons the template will be created with
» footer body string false Optional footer text block for template
<—> <—> <—> <—> AUTHENTICATION payload
» language body string true Template language
» name body string true Unique template name and also primary key
» category body string true Template category
» options body object false Optional template parameters
»» addSecurityRecommendation body boolean false Set to true if you want the template to include the string.
»» codeExpirationMinutes body number false Indicates number of minutes the password or code is valid.
» buttons body object true Optional buttons block for template
»» otp body object true One-time password button
»»» type body string false Indicates OTP button type.
»»» text body string true Copy code button text.

Enumerated Values

order: -1 1

» category: MARKETING UTILITY AUTHENTICATION

» language: af sq ar az bn bg ca zh_CN zh_HK zh_TW hr cs da nl en en_GB en_US et fil fi fr ka de el gu ha he hi hu id ga it ja kn kk rw_RW ko ky_KG lo lv lt mk ms ml mr nb fa pl pt_BR pt_PT pa ro ru sr sk sl es es_AR es_ES es_MX sw sv ta te th tr uk ur uz vi zu

»» type: NONE TEXT IMAGE VIDEO DOCUMENT CTA QUICK_REPLY OTP

»» CTAOrder: PHONE WEBSITE

»»» type: COPY_CODE

Example responses

200 Response

{
"template": {
"id": "493480348725846",
"category": "APPOINTMENT_UPDATE",
"status": "APPROVED",
"language": "af",
"name": "button_for_demo_1",
"preview": "some text",
"components": [
{
"type": "BODY",
"text": "some text"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "button 1"
},
{
"type": "QUICK_REPLY",
"text": "button 3"
}
]
}
]
}
}

Responses

Status Meaning Description
200 OK
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
410 Gone Entity was removed
502 Bad Gateway Received an invalid response from the upstream server

Response Schema

Enumerated Values

type: TEXT IMAGE VIDEO DOCUMENT NONE CTA QUICK_REPLY OTP

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 502

Received an invalid response from the upstream server

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get WhatsApp template by ID

Code samples

GET https://omni.mmdsmart.com/api/agents/whatsapp/{agent_id}/templates/{template_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/agents/whatsapp/{agent_id}/templates/{template_id}

Retrieve WhatsApp template by ID for current user and agent.

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
template_id path string true Template ID
Authorization header string true User token used for authorization

Example responses

200 Response

{
"template": {
"id": "493480348725846",
"category": "APPOINTMENT_UPDATE",
"status": "APPROVED",
"language": "af",
"name": "button_for_demo_1",
"preview": "some text",
"components": [
{
"type": "BODY",
"text": "some text"
},
{
"type": "BUTTONS",
"buttons": [
{
"type": "QUICK_REPLY",
"text": "button 1"
},
{
"type": "QUICK_REPLY",
"text": "button 3"
}
]
}
]
}
}

Responses

Status Meaning Description
200 OK WhatsApp template
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
410 Gone Entity was removed
502 Bad Gateway Received an invalid response from the upstream server

Response Schema

Status Code 200

WhatsApp template

Name Type Description
» template object FB template object
»» id string FB template ID
»» category string FB template category
»» status string FB template status
»» language string FB template language
»» name string FB template name
»» body string FB template body
»» header object FB template header
»»» type string
»»» value string¦null
»» buttons object FB template buttons
»»» type string
»»» text string
»»» CTAOrder [any]
»»» phone object
»»»» text string
»»»» number string
»»» website object
»»»» text string
»»»» link string
»»» quickReplyBlocks [string]
»» footer string¦null FB template footer
» namespace string

Enumerated Values

type: TEXT IMAGE VIDEO DOCUMENT NONE CTA QUICK_REPLY OTP

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 502

Received an invalid response from the upstream server

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Modify a specific WhatsApp template

Code samples

PUT https://omni.mmdsmart.com/api/agents/whatsapp/{agent_id}/templates/{template_id} HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

PUT /api/agents/whatsapp/{agent_id}/templates/{template_id}

Modify a specific WhatsApp template by ID. Template can not be changed more than 1 time in 24 hours or 10 times in 30 days.

Body parameter

{
"body": "Hello world!",
"body_examples": [
"body_variable_example_1",
"body_variable_example_2"
],
"header_examples": [
"header_variable_example"
],
"header": {
"type": "TEXT",
"value": "Hello header!"
},
"buttons": {
"otp": {
"type": "COPY_CODE",
"text": "Copy Code"
}
},
"footer": "Beautiful footer",
"options": {
"addSecurityRecommendation": true,
"codeExpirationMinutes": 1
}
}

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
template_id path string true WA template ID
Authorization header string true User token used for authorization
body body string false Body text block for template
body_examples body [string] false Examples for body variables
header_examples body [string] false Examples for header variables
header body object false Optional header block for template
» type body string true Header type for template
» value body string true Header value depends on its type
buttons body object false Optional buttons block for template
» otp body object false One-time password button
»» type body string false Indicates OTP button type.
»» text body string true Copy code button text.
footer body string false Optional footer text block for template
options body object false Optional template parameters
» addSecurityRecommendation body boolean false Set to true if you want the template to include the string.
» codeExpirationMinutes body number false Indicates number of minutes the password or code is valid.

Enumerated Values

» type: NONE TEXT IMAGE VIDEO DOCUMENT

»» type: COPY_CODE

Example responses

204 Response

{}

Responses

Status Meaning Description
204 No Content Successfully edited WhatsApp template
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
410 Gone Entity was removed
502 Bad Gateway Received an invalid response from the upstream server

Response Schema

Status Code 204

Successfully edited WhatsApp template

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 502

Received an invalid response from the upstream server

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get WhatsApp template active broadcast

Code samples

GET https://omni.mmdsmart.com/api/agents/whatsapp/{agent_id}/templates/active-broadcast HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/agents/whatsapp/{agent_id}/templates/active-broadcast

Check if the template has active broadcast.

Parameters

Name In Type Required Description
oneOf query any false
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization

Example responses

200 Response

{
"isActive": true
}

Responses

Status Meaning Description
200 OK
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized

Response Schema

Status Code 200

Name Type Description
» isActive boolean Does the template have active broadcast.

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Delete WhatsApp template

Code samples

DELETE https://omni.mmdsmart.com/api/agents/whatsapp/{agent_id}/templates/{name} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

DELETE /api/agents/whatsapp/{agent_id}/templates/{name}

Delete WhatsApp template for current user and agent.

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
name path string true Name of template
Authorization header string true User token used for authorization

Example responses

204 Response

{}

Responses

Status Meaning Description
204 No Content Successfully deleted WhatsApp template
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
410 Gone Entity was removed

Response Schema

Status Code 204

Successfully deleted WhatsApp template

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

WeChat

Send WeChat message

Code samples

POST https://omni.mmdsmart.com/api/agents/wechat/{agent_id}/send HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/agents/wechat/{agent_id}/send

Body parameter

{
"customerNumber": "string",
"payload": null
}

Parameters

Name In Type Required Description
agent_id path string(uuid) true Agent ID
Authorization header string true User token used for authorization
customerNumber body string true
payload body any true

Example responses

200 Response

{
"message_id": "1a45bd2c-f94d-4e80-a335-5856b3f232f7"
}

Responses

Status Meaning Description
200 OK Message was sent successfully
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found
410 Gone Entity was removed

Response Schema

Status Code 200

Message was sent successfully

Name Type Description
» message_id string(uuid) Message ID in database

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 410

Entity was removed

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Chatbot stories

Get all available stories

Code samples

GET https://omni.mmdsmart.com/api/scenarios HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/scenarios

Get all available chatbot stories from enabled chatbots for current user

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization

Example responses

200 Response

{
"stories": [
{
"id": "12134243434",
"origin": "OWN",
"description": "Cool chatbot",
"name": "test chatbot"
},
{
"id": "343435p5po45",
"origin": "CHATBOT_COM",
"description": null,
"name": "New test"
},
{
"id": "bdfe0580-de29-4f72-a789-860024af3cdc",
"origin": "DIALOGFLOW",
"description": null,
"name": "Dialogflow chatbot"
}
]
}

Responses

Status Meaning Description
200 OK Successfully returned chatbot stories
401 Unauthorized Unauthorized

Response Schema

Status Code 200

Successfully returned chatbot stories

Name Type Description
» stories [object] Successfully returned chatbot stories
»» id string(uuid) Chatbot story ID
»» origin string Chatbot story origin
»» description string Chatbot description
»» name string Chatbot name

Enumerated Values

origin: OWN CHATBOT_COM DIALOGFLOW

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Templates

Get templates

Code samples

GET https://omni.mmdsmart.com/api/templates HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/templates

Retrieve templates with pagination options

Parameters

Name In Type Required Description
type query string false
offset query number false Sets the first position to return from the results of the request. Default - 0
limit query number false The number of entities to return in result. Default - 50
sort query string false The field by which entities in result are sorted. Default - created
order query number false Direction of entities sorting - ascending (1) or descending (-1). Default - 1
search query string false The field by which entities in result are searched
Authorization header string true User token used for authorization

Enumerated Values

type: CARD_TEMPLATE TEXT_TEMPLATE LIST_TEMPLATE CAROUSEL_TEMPLATE

order: -1 1

Example responses

200 Response

{
"templates": [
{
"_id": "7899f3f8-e74b-4ed1-abac-0bedda8f5db8",
"enterprise_id": "b243b42a-d89f-1381-4cb7-fc7b771beb21",
"user_id": "7361294a-2ede-e784-b6e6-07e630a2a627",
"payload": {
"type": "TEXT_TEMPLATE",
"title": "Some text template",
"text": "Good day!"
},
"created": "2022-08-08T15:05:08.404Z",
"modified": "2022-08-08T15:05:08.404Z"
}
],
"total": 1,
"offset": 0,
"limit": 50
}

Responses

Status Meaning Description
200 OK Settings returned templates
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized

Response Schema

Status Code 200

Settings returned templates

Name Type Description
» templates [any] Successfully returned templates
» total number Total amount of entities for current user
» offset number Sets the first position to return from the results of the request. Default - 0
» limit number The number of entities to return in result. Default - 50

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Create a template

Code samples

POST https://omni.mmdsmart.com/api/templates HTTP/1.1
Host: omni.mmdsmart.com
Content-Type: application/json
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

POST /api/templates

Create a template

Body parameter

{
"type": null,
"title": "string",
"text": "string"
}

Parameters

Name In Type Required Description
Authorization header string true User token used for authorization

Example responses

201 Response

{
"_id": "7899f3f8-e74b-4ed1-abac-0bedda8f5db8",
"enterprise_id": "b243b42a-d89f-1381-4cb7-fc7b771beb21",
"user_id": "7361294a-2ede-e784-b6e6-07e630a2a627",
"payload": {
"type": "CARD_TEMPLATE",
"title": "Some text template",
"text": "Good day!"
},
"created": "2022-08-08T15:05:08.404Z",
"modified": "2022-08-08T15:05:08.404Z"
}

Responses

Status Meaning Description
201 Created Successfully created a template
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized

Response Schema

Status Code 201

Successfully created a template

Name Type Description
» template any

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Get template by ID

Code samples

GET https://omni.mmdsmart.com/api/templates/{template_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

GET /api/templates/{template_id}

Retrieve templates with given ID

Parameters

Name In Type Required Description
template_id path string(uuid) true Template ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{
"template": {
"_id": "7899f3f8-e74b-4ed1-abac-0bedda8f5db8",
"enterprise_id": "b243b42a-d89f-1381-4cb7-fc7b771beb21",
"user_id": "7361294a-2ede-e784-b6e6-07e630a2a627",
"payload": {
"type": "CARD_TEMPLATE",
"title": "Some text template",
"text": "Good day!"
},
"created": "2022-08-08T15:05:08.404Z",
"modified": "2022-08-08T15:05:08.404Z"
}
}

Responses

Status Meaning Description
200 OK Returns template
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found

Response Schema

Status Code 200

Returns template

Name Type Description
» template any

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Delete a specific template

Code samples

DELETE https://omni.mmdsmart.com/api/templates/{template_id} HTTP/1.1
Host: omni.mmdsmart.com
Accept: application/json
Authorization: eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6Im9tbmkifQ.eyJpZCI6ImU4MDQwZDBiLTgzMGUtNGUxOS04MWE3LWRhOWE4Y2FlNmMyNyIsImFkbWluRW1haWwiOiIiLCJzdWIiOiJhcGkiLCJhdWQiOiJhbm9uIiwiaXNzIjoib21uaSIsImlhdCI6MTcwODU4NjY0NywiZXhwIjoxNzA4NjczMDQ3fQ.gVIM_MG0SvjKKJ1khXToqacJoGOIYEblb8M3eOSOYRJCzgopwUYUNx7qOr3XBjUdRDpBB4MtkVro4fuCh-nj3B0-A06k4ctV8AB8zz9SMouAKdDkCDlKWjoZMhMm3x2kaBrhmKFiF1w3vOo9MJ9IwVimLl95dHtGSqzlYQ8qtch_HxNhETNU8JthzropLEi_J9WtZj0p3xlrsV55WhWLUmyYzFVIiJnzAM1z_YvMMsA_EmBxbOjChHMJpfZlFmdvC5H4Q-PRS5ldg6JawtzmXf0nIB8Ki3k7qo5oxXItSXsuCEls59Nt_99kkWx6NIr7rTJvvlWoHehKsKgY3DMnTw

DELETE /api/templates/{template_id}

Delete template with given ID

Parameters

Name In Type Required Description
template_id path string(uuid) true Template ID in database
Authorization header string true User token used for authorization

Example responses

200 Response

{
"success": true
}

Responses

Status Meaning Description
200 OK Template was successfully removed
400 Bad Request One or more given parameters are invalid or missing required parameters
401 Unauthorized Unauthorized
403 Forbidden Forbidden
404 Not Found Entity not found

Response Schema

Status Code 200

Template was successfully removed

Name Type Description
» success boolean Whether the request was successfully processed

Status Code 400

One or more given parameters are invalid or missing required parameters

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 401

Unauthorized

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 403

Forbidden

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed

Status Code 404

Entity not found

Name Type Description
» success boolean Whether the request was successfully processed
» reason string Reason why the request wasn’t processed
» statusCode number Status error code
» error string Short error message
» message string Reason why the request wasn’t processed