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
Name | Value |
---|---|
Requires authentication? | Yes |
Rate limited? | No |
Request
Request headers
Key | Value |
---|---|
Authorization | Bearer token |
Content-Type | application/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 Name | Type | Description |
---|---|---|
serviceUuid | String | UUID of the service through which signature needs to be send. |
messageType | String | The mpower chat message type. |
version | Integer | Message gateway version number. |
messageText | String | Message to be displayed while sending document. |
alignment | String | Specify your choice of text alighnment. |
backgroundColor | String | Specify the hex color code for the background color. |
textColor | String | Specify the hex color code for the text color. |
instanceId | String | Some 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 Name | Type | Description |
---|---|---|
messageId | String | Unique ID for the message. |
instanceId | String | InstanceID of the request. |
Sample Response
{
"messageId": "9vdKGlQOVU9gpNbGtC",
"instanceId": "instance-7a7d1208-9ef5-42c1-97a3-99fe309ba583"
}
Response Status Information
Status | Type | Description |
---|---|---|
200 | OK | For successfull update |
400 | status | Bad request |
401 | status | Unauthorized |