Skip to main content

mPowerChat Choice Message

mPowerChat Choice is a messaging API similar to mPowerChat Message, except that it enables user interaction. An interactive message or a question along with response choices (as buttons) can be added to the message, to get user preferences. Additionally there are styling options for customizing the response choice objects (the buttons and the button text) by adding background color, text color and alignment options.

Resource Informations

NameValue
Requires authentication?Yes
Rate limited?No

Request

Request headers

KeyValue
AuthorizationBearer token
Content-Typeapplication/json

HTTP request URL for SSMS

POST  https://{tenantId}.{hostname}/digitanium/v3/mpower/users/{userName}/chat/message

HTTP request URL for SHIFT

POST  https://{hostname}/auth/realms/{tenantId}/mpower/v1/users/{userName}/message?category={CATEGORY}
note

API requests must be made over https. Calls made over plain http will fail.

Parameters

No Parameter fields are required.

Request Body

Field NameTypeDescription
serviceUuidStringUUID of the service through which signature needs to be send.
messageTypeStringThe mpower chat message type.
versionIntegerMessage gateway version number.
messageTextStringMessage to be displayed while sending document.
alignmentStringSpecify your choice of text alighnment.
backgroundColorStringSpecify the hex color code for the background color.
textColorStringSpecify the hex color code for the text color.
instanceIdStringSome string value.If not provided by default a Random ID will be assigned.

Sample Request

{
"serviceUuid": "{service-uuid}",
"messageType": "choiceRequest",
"version": 3,
"messageContent": {
"messageText": "string",
"alignment": "horizontal",
"choices": [{
"style": {
"disabled": {
"backgroundColor": "#E0E0E0",
"textColor": "#FFFFFF"
},
"normal": {
"backgroundColor": "#0b8b1e",
"textColor": "#ffffff"
},
"pressed": {
"backgroundColor": "#0b8b1e",
"textColor": "#9b9797"
},
"selected": {
"backgroundColor": "#0b8b1e",
"textColor": "#9b9797"
}
},
"text": "Yes"
}, {
"style": {
"disabled": {
"backgroundColor": "#E0E0E0",
"textColor": "#FFFFFF"
},
"normal": {
"backgroundColor": "#f80c0c",
"textColor": "#ffffff"
},
"pressed": {
"backgroundColor": "#580a0a",
"textColor": "#9b9797"
},
"selected": {
"backgroundColor": "#580a0a",
"textColor": "#505050"
}
},
"text": "No"
}
]
}

Response

Field NameTypeDescription
messageIdStringUnique ID for the message.
instanceIdStringInstanceID of the request.

Sample Response

{
"messageId": "9vdKGlQOVU9gpNbGtC",
"instanceId": "instance-7a7d1208-9ef5-42c1-97a3-99fe309ba583"
}

Response Status Information

StatusTypeDescription
200OKFor successfull update
400statusBad request
401statusUnauthorized