Function
1. What is Function
A Function is an API(specified by ChannelTalk) used to request features of an App.
All requests to an app follow the Function
schema
2. Function Handling
A Function sends HTTP PUT requests to the Function Endpoint
, which is registered to an app.
You can register the Function Endpoint in [App Settings]
- [General Settings]
- [Server Settings]
.
Additionally, you can generate a Signing Key
to check the validity of a request(whether if it came from ChannelTalk).
Your app server should provide the HTTP API to handle and response back to such requests.
HTTP API
url | {Function Endpoint registered above} |
---|---|
method | PUT |
notes | requested from ChannelTalk to your App Server |
Request
header
name | notes | required |
---|---|---|
X-Signature | HMAC signature signed using the Signing Key | true |
How to verify X-Signature
- Encode the signing key to hexadecimal bytes.
- Encode the request body to UTF-8 bytes.
- Using the secret key from step one and HMAC SHA-256 function, compute the digest of the value from step two.
- Encode the digest to base64.
- Compare the value from step four to the X-Signature in the request header.
// Java example
String signingKey = "..."; // signing key
String requestBody = "..."; // request body string
SecretKeySpec key = new SecretKeySpec(DatatypeConverter.parseHexBinary(signingKey), "HmacSHA256");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(key);
byte[] source = requestBody.getBytes(StandardCharsets.UTF_8);
byte[] digest = mac.doFinal(source);
String signature = Base64.encodeBase64String(digest);
// Compare X-Signature header and signature
body
{
"method": "METHOD_NAME",
"params": {
"YOUR_ARGS[0]": "PROVIDED_PARAMS[0]",
"YOUR_ARGS[1]": "PROVIDED_PARAMS[1]",
},
"context": {
"channel": { "id": "CHANNEL_ID" },
"caller": { "type": "CALLER_TYPE", "id": "CALLER_ID" }
}
}
field | type | notes |
---|---|---|
method | string | name of the specific feature to call by function (rpc name) |
params | array or object | function body. json data passed by function |
context | object | context info of function call. described below |
context
- Context is the background info attached by ChannelTalk.
- You can rely on the data in context. (if you verified the X-Signature)
field | type | notes |
---|---|---|
channel | object | id: id of the channel where the function was called |
caller | object | type: type of caller | app, user, manager id: id of caller |
Response
Either result
or error
field | type | notes |
---|---|---|
result | object or array | response of successful status code |
error | object | response of failing status code |
success
{
"result": {
}
}
failure
{
"error": {
"type": "..."
"message": "..."
}
}
field | type | notes |
---|---|---|
type | string | error type |
message | string | error message |
3. Function Calling
You can also call a function
of a different app from your app.
Send a request to the ChannelTalk API server using the Function
schema described below with the ID of the app.
endpoint | app-store-api.channel.io/general/v1/apps/{appID}/functions |
---|---|
method | PUT |
notes | calls the function of a different app installed to the channel |
-
Request
header
name notes required x-access-token Channel token issued from Authentication true body
{ "method": "METHOD_NAME", "params": { "YOUR_ARGS[0]": "PROVIDED_PARAMS[0]", "YOUR_ARGS[1]": "PROVIDED_PARAMS[1]", ... } }
field type notes method string name of the specific feature to call by function (rpc name) params array or object function body. json data passed by function -
Response
Either
result
orerror
field type notes result array or object response of successful status code error object response of failing status code success
{ "result": { ... } }
failure
{ "error": { "type": "..." "message": "..." } }
field type notes type string error type message string error message
4. Native Function Calling
Native Function
is a Function API provided by ChannelTalk to manipulate the resources of ChannelTalk. You can write user chat messages, read the info of a manager and etc, which are part of the ChannelTalk resources. Read below on how to call a Native Function
.
url | app-store-api.channel.io/general/v1/native/functions |
---|---|
method | PUT |
notes | call Native Function offered by ChannelTalk |
-
Request
header
name notes required x-access-token Channel token issued from Authentication true body
{ "method": "METHOD_NAME", "params": { "YOUR_ARGS[0]": "PROVIDED_PARAMS[0]", "YOUR_ARGS[1]": "PROVIDED_PARAMS[1]", ... } }
field type notes method string name of the specific feature to call by function (rpc name) params array or object function body. json data passed by function -
Response
Either
result
orerror
field type notes result object response of successful status code error object response of failing status code success
{ "result": { ... } }
failure
{ "error": { "type": "..." "message": "..." } }
field type notes type string error type message string error message
5. Currently Available Native Functions
App
registerCommands
request body
{
"method": "registerCommands",
"params": {
"appId": "...",
"commands": [
"name": "...",
"scope": "...",
"description": "...",
"nameDescI18nMap": {
"en": {
"name": "...",
"description": "..."
},
},
"actionFunctionName": "...",
"autoCompleteFunctionName": "..."
"paramDefinitions": [
{
"name": "...",
"type": "...", // "string", "float", "int", "bool"
"required": false,
"description": "...", // nullable
"choices": [ // nullable
{
"name": "...",
"value": { // any
},
"nameDescI18nMap": { // nullable
"en": {
},
}
},
],
"nameDescI18nMap": { // nullable
"en": {
},
}
"autoComplete": false, // nullable
"alfDescription": "..." // nullable
},
],
"enabledByDefault": true
]
}
}
response body
{}
Channel
writeGroupMessage
request body
{
"method": "writeGroupMessage",
"params": {
"channelId": "...",
"groupId": "...",
"rootMessageId": "...",
"broadcast": false,
"dto": {
"blocks": [
{ },
],
"plainText": "...",
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"options": [
"...",
],
"requestId": "...",
"botName": "..."
}
}
}
response body
{
"result": {
"message": {
"id": "...",
"channelId": "...",
"chatType": "...",
"chatId": "...",
"personType": "...",
"personId": "...",
"requestId": "...",
"language": "...",
"createdAt": ,
"version": ,
"blocks": [
{ },
],
"plainText": "...",
"updatedAt": ,
"inboundEmailId": "...",
"thread": {
"id": "...",
"managerIds": [
"...",
],
"repliedManagerIds": [
"...",
],
"replyCount":
},
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"state": "...",
"options": [
"...",
]
}
}
}
writeUserChatMessage
request body
{
"method": "writeUserChatMessage",
"params": {
"channelId": "...",
"userChatId": "...",
"dto": {
"blocks": [
{ },
],
"plainText": "...",
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"options": [
"...",
],
"requestId": "...",
"botName": "..."
}
}
}
response body
{
"result": {
"message": {
"id": "...",
"channelId": "...",
"chatType": "...",
"chatId": "...",
"personType": "...",
"personId": "...",
"requestId": "...",
"language": "...",
"createdAt": ,
"version": ,
"blocks": [
{ },
],
"plainText": "...",
"updatedAt": ,
"inboundEmailId": "...",
"thread": {
"id": "...",
"managerIds": [
"...",
],
"repliedManagerIds": [
"...",
],
"replyCount":
},
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"state": "...",
"options": [
"...",
]
}
}
}
getManager
request body
{
"method": "getManager",
"params": {
"channelId": "...",
"managerId": "..."
}
}
response body
{
"result": {
"manager": {
"id": "...",
"channelId": "...",
"accountId": "...",
"name": "...",
"description": "...",
"showDescriptionToFront": false,
"nameDescI18nMap": {
"en": {
"name": "...",
"description": "..."
},
},
"profile": {
},
"email": "...",
"showEmailToFront": false,
"roleId": "...",
"removed": false,
"createdAt": ,
"UpdatedAt": ,
"displayAsChannel": false,
"defaultGroupWatch": "...",
"defaultDirectChatWatch": "...",
"defaultUserChatWatch": "...",
"chatAlertSound": "...",
"meetAlertSound": "...",
"showPrivateMessagePreview": false,
"operatorScore": ,
"touchScore": ,
"operatorEmailReminder": false,
"receiveUnassignedChatAlert": false,
"receiveUnassignedMeetAlert": false,
"operator": false,
"defaultAllMentionImportant": false,
"userMessageImportant": false,
"autoAssignCapacity": ,
"statusEmoji": "...",
"statusText": "...",
"statusClearAt": ,
"doNotDisturb": false,
"doNotDisturbClearAt": ,
"accountDoNotDisturb": false,
"accountDoNotDisturbClearAt": ,
"enableReactedMessageIndex": false,
"operatorUpdatedAt": ,
"avatarUrl": "...",
"emailForFront": "...",
"mobileNumberForFront": "...",
"meetOperator": false
}
}
}
batchGetManagers
request body
{
"method": "batchGetManagers",
"params": {
"channelId": "...",
"managerIds": [ number of ids min: 1 max: 50
"...",
]
}
}
response body
{
"result": {
"managers": [
{
"id": "...",
"channelId": "...",
"accountId": "...",
"name": "...",
"description": "...",
"showDescriptionToFront": false,
"nameDescI18nMap": {
"en": {
"name": "...",
"description": "..."
},
},
"profile": {
},
"email": "...",
"showEmailToFront": false,
"roleId": "...",
"removed": false,
"createdAt": ,
"UpdatedAt": ,
"displayAsChannel": false,
"defaultGroupWatch": "...",
"defaultDirectChatWatch": "...",
"defaultUserChatWatch": "...",
"chatAlertSound": "...",
"meetAlertSound": "...",
"showPrivateMessagePreview": false,
"operatorScore": ,
"touchScore": ,
"operatorEmailReminder": false,
"receiveUnassignedChatAlert": false,
"receiveUnassignedMeetAlert": false,
"operator": false,
"defaultAllMentionImportant": false,
"userMessageImportant": false,
"autoAssignCapacity": ,
"statusEmoji": "...",
"statusText": "...",
"statusClearAt": ,
"doNotDisturb": false,
"doNotDisturbClearAt": ,
"accountDoNotDisturb": false,
"accountDoNotDisturbClearAt": ,
"enableReactedMessageIndex": false,
"operatorUpdatedAt": ,
"avatarUrl": "...",
"emailForFront": "...",
"mobileNumberForFront": "...",
"meetOperator": false
},
]
}
}
searchManagers
request body
{
"method": "searchManagers",
"params": {
"channelId": "...",
"pagination": {
"sortOrder": "...",
"since": "...",
"limit":
}
}
}
response body
{
"result": {
"managers": [
{
"id": "...",
"channelId": "...",
"accountId": "...",
"name": "...",
"description": "...",
"showDescriptionToFront": false,
"nameDescI18nMap": {
"en": {
"name": "...",
"description": "..."
},
},
"profile": {
},
"email": "...",
"showEmailToFront": false,
"roleId": "...",
"removed": false,
"createdAt": ,
"UpdatedAt": ,
"displayAsChannel": false,
"defaultGroupWatch": "...",
"defaultDirectChatWatch": "...",
"defaultUserChatWatch": "...",
"chatAlertSound": "...",
"meetAlertSound": "...",
"showPrivateMessagePreview": false,
"operatorScore": ,
"touchScore": ,
"operatorEmailReminder": false,
"receiveUnassignedChatAlert": false,
"receiveUnassignedMeetAlert": false,
"operator": false,
"defaultAllMentionImportant": false,
"userMessageImportant": false,
"autoAssignCapacity": ,
"statusEmoji": "...",
"statusText": "...",
"statusClearAt": ,
"doNotDisturb": false,
"doNotDisturbClearAt": ,
"accountDoNotDisturb": false,
"accountDoNotDisturbClearAt": ,
"enableReactedMessageIndex": false,
"operatorUpdatedAt": ,
"avatarUrl": "...",
"emailForFront": "...",
"mobileNumberForFront": "...",
"meetOperator": false
},
],
"next": "..."
}
}
getUserChat
request body
{
"method": "getUserChat",
"params": {
"channelId": "...",
"userChatId": "..."
}
}
response body
{
"result": {
"userChat": {
"id" : "...",
"channelId" : "...",
"contactMediumType" : "...",
"liveMeetId" : "...",
"sync" : false,
"state" : "...",
"missedReason" : "...",
"managed" : false,
"userId" : "...",
"xerId" : "...",
"name" : "...",
"title" : "...",
"description" : "...",
"subtextType" : "...",
"handling" : {
},
"source" : {
},
"managerIds" : [
"...",
],
"assigneeId" : "...",
"teamId" : "...",
"tags" : [
"...",
],
"goalEventName" : "...",
"goalEventQuery" : {
},
"goalCheckedAt" : ,
"goalState" : "...",
"firstOpenedAt" : ,
"openedAt" : ,
"createdAt" : ,
"updatedAt" : ,
"frontMessageId" : "...",
"frontUpdatedAt" : ,
"deskMessageId" : "...",
"deskUpdatedAt" : ,
"firstAssigneeIdAfterOpen" : "...",
"firstRepliedAtAfterOpen" : ,
"oneStop" : false,
"waitingTime" : ,
"avgReplyTime" : ,
"totalReplyTime" : ,
"replyCount" : ,
"resolutionTime" : ,
"operationWaitingTime" : ,
"operationAvgReplyTime" : ,
"operationTotalReplyTime" : ,
"operationReplyCount" : ,
"operationResolutionTime" : ,
"firstAskedAt" : ,
"askedAt" : ,
"closedAt" : ,
"snoozedAt" : ,
"expiresAt" : ,
"version" :
}
}
}
getUser
request body
{
"method": "getUser",
"params": {
"channelId": "...",
"userId": "..."
}
}
response body
{
"result": {
"user": {
"id" : "...",
"channelId" : "...",
"memberId" : "...",
"veilId" : "...",
"unifiedId" : "...",
"type" : "...",
"name" : "...",
"mobileNumberQualified" : false,
"emailQualified" : false,
"profile" : {
},
"tags" : [
"...",
],
"alert" : ,
"unread" : ,
"popUpChatId" : "...",
"blocked" : false,
"unsubscribeEmail" : false,
"unsubscribeTexting" : false,
"hasChat" : false,
"mainChatId" : "...",
"hasPushToken" : false,
"language" : "...",
"country" : "...",
"timeZone" : "...",
"province" : "...",
"city" : "...",
"latitude" : ,
"longitude" : ,
"web" : {
},
"mobile" : {
},
"sessionsCount" : ,
"lastSeenAt" : ,
"createdAt" : ,
"updatedAt" : ,
"version" :
}
}
}
getChannel
request body
{
"method": "getChannel",
"params": {
"channelId": "..."
}
}
response body
{
"result": {
"channel": {
"id" : "...",
"createdAt" : ,
"updatedAt" : ,
"state" : "...",
"blocked" : false,
"name" : "...",
"description" : "...",
"nameDescI18nMap" : {
"en": {
"name": "...",
"description": "..."
},
},
"botName" : "...",
"color" : "...",
"country" : "...",
"domain" : "...",
"systemDomain" : "...",
"homepageUrl" : "...",
"phoneNumber" : "...",
"timezone" : "...",
"utcOffset" : "...",
"bizCertificated" : false,
"bizCertificatedCountries" : [
"...",
],
"defaultPluginId" : "...",
"welcomeMessage" : {
},
"welcomeMessageI18nMap" : {
"en": {
},
},
"expectedResponseDelay" : "...",
"showOperatorProfile" : false,
"inOperation" : false,
"working" : false,
"operationTimeScheduling" : false,
"nextWorkingTime" : ,
"nextAwayTime" : ,
"nextOperatingAt" : ,
"operationTimeRanges" : [
{
"dayOfWeeks": [
"...",
],
"from": ,
"to":
},
],
"awayOption" : "...",
"blockReplyingAfterClosed" : false,
"blockReplyingAfterClosedTime" : ,
"followUpTexting" : false,
"followUpEmail" : false,
"followUpAskName" : false,
"followUpMandatory" : false,
"avatarUrl" : "...",
"initial" : "...",
"borderColor" : "...",
"gradientColor" : "...",
"textColor" : "...",
"brightness" : ,
"coverImageColor" : "...",
"coverImageUrl" : "...",
"coverImageBright" : false,
"appCommerceId" : "...",
"appCommerceType" : "...",
"appCommerceDomain" : "...",
"defaultEmailDomainId" : "...",
"hideAppMessenger" : false,
"userInfoUrl" : "...",
"enableMemberHash" : false,
"enableMfa" : false,
"indebtedDueDate" : "...",
"entVerified" : false,
"sourceSurvey" : {
},
"bizCategory" : "...",
"staffs" : ,
"trafficSource" : {
},
"baseTutorialCompleted" : false,
"managedUserChatRetentionDuration" :
}
}
}
manageUserChat
request body
{
"method": "getUserChat",
"params": {
"channelId": "...",
"userChatId": "..."
}
}
response body
{
"result": {
"userChat": {
"id" : "...",
"channelId" : "...",
"contactMediumType" : "...",
"liveMeetId" : "...",
"sync" : false,
"state" : "...",
"missedReason" : "...",
"managed" : false,
"userId" : "...",
"xerId" : "...",
"name" : "...",
"title" : "...",
"description" : "...",
"subtextType" : "...",
"handling" : {
},
"source" : {
},
"managerIds" : [
"...",
],
"assigneeId" : "...",
"teamId" : "...",
"tags" : [
"...",
],
"goalEventName" : "...",
"goalEventQuery" : {
},
"goalCheckedAt" : ,
"goalState" : "...",
"firstOpenedAt" : ,
"openedAt" : ,
"createdAt" : ,
"updatedAt" : ,
"frontMessageId" : "...",
"frontUpdatedAt" : ,
"deskMessageId" : "...",
"deskUpdatedAt" : ,
"firstAssigneeIdAfterOpen" : "...",
"firstRepliedAtAfterOpen" : ,
"oneStop" : false,
"waitingTime" : ,
"avgReplyTime" : ,
"totalReplyTime" : ,
"replyCount" : ,
"resolutionTime" : ,
"operationWaitingTime" : ,
"operationAvgReplyTime" : ,
"operationTotalReplyTime" : ,
"operationReplyCount" : ,
"operationResolutionTime" : ,
"firstAskedAt" : ,
"askedAt" : ,
"closedAt" : ,
"snoozedAt" : ,
"expiresAt" : ,
"version" :
}
}
}
Manager
writeGroupMessageAsManager
request body
{
"method": "writeGroupMessageAsManager",
"params": {
"channelId": "...",
"groupId": "...",
"rootMessageId": "...",
"broadcast": false,
"dto": {
"blocks": [
{ },
],
"plainText": "...",
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"options": [
"...",
],
"requestId": "...",
"managerId": "..."
}
}
}
response body
{
"result": {
"message": {
"id": "...",
"channelId": "...",
"chatType": "...",
"chatId": "...",
"personType": "...",
"personId": "...",
"requestId": "...",
"language": "...",
"createdAt": ,
"version": ,
"blocks": [
{ },
],
"plainText": "...",
"updatedAt": ,
"inboundEmailId": "...",
"thread": {
"id": "...",
"managerIds": [
"...",
],
"repliedManagerIds": [
"...",
],
"replyCount":
},
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"state": "...",
"options": [
"...",
]
}
}
}
writeUserChatMessageAsManager
request body
{
"method": "writeUserChatMessageAsManager",
"params": {
"channelId": "...",
"userChatId": "...",
"dto": {
"blocks": [
{ },
],
"plainText": "...",
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"options": [
"...",
],
"requestId": "...",
"managerId": "..."
}
}
}
response body
{
"result": {
"message": {
"id": "...",
"channelId": "...",
"chatType": "...",
"chatId": "...",
"personType": "...",
"personId": "...",
"requestId": "...",
"language": "...",
"createdAt": ,
"version": ,
"blocks": [
{ },
],
"plainText": "...",
"updatedAt": ,
"inboundEmailId": "...",
"thread": {
"id": "...",
"managerIds": [
"...",
],
"repliedManagerIds": [
"...",
],
"replyCount":
},
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"state": "...",
"options": [
"...",
]
}
}
}
writeDirectChatMessageAsManager
request body
{
"method": "writeDirectChatMessageAsManager",
"params": {
"directChatId": "...",
"channelId": "...",
"rootMessageId": "...",
"broadcast": false,
"dto": {
"blocks": [
{ },
],
"plainText": "...",
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"options": [
"...",
],
"requestId": "...",
"managerId": "..."
}
}
}
response body
{
"result": {
"message": {
"id": "...",
"channelId": "...",
"chatType": "...",
"chatId": "...",
"personType": "...",
"personId": "...",
"requestId": "...",
"language": "...",
"createdAt": ,
"version": ,
"blocks": [
{ },
],
"plainText": "...",
"updatedAt": ,
"inboundEmailId": "...",
"thread": {
"id": "...",
"managerIds": [
"...",
],
"repliedManagerIds": [
"...",
],
"replyCount":
},
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"state": "...",
"options": [
"...",
]
}
}
}
User
writeUserChatMessageAsUser
request body
{
"method": "writeUserChatMessageAsUser",
"params": {
"channelId": "...",
"userChatId": "...",
"dto": {
"blocks": [
{ },
],
"plainText": "...",
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"options": [
"...",
],
"requestId": "...",
"userId": "..."
}
}
}
response body
{
"result": {
"message": {
"id": "...",
"channelId": "...",
"chatType": "...",
"chatId": "...",
"personType": "...",
"personId": "...",
"requestId": "...",
"language": "...",
"createdAt": ,
"version": ,
"blocks": [
{ },
],
"plainText": "...",
"updatedAt": ,
"inboundEmailId": "...",
"thread": {
"id": "...",
"managerIds": [
"...",
],
"repliedManagerIds": [
"...",
],
"replyCount":
},
"buttons": [
{
"title": "...",
"colorVariant": "...",
"action": { // one of commandAction, webAction, wamAction
"commandAction": { // option 1
"attributes" : {
"appId": "...",
"name": "...",
"params": {
}
}
}
"webAction": { // option 2
"attributes" : {
"url": "..."
}
}
"wamAction": { // option 3
"attributes" : {
"appId": "...",
"clientId": "...",
"name": "...",
"wamArgs": {
}
}
}
}
},
],
"files": [
{
"url": "...",
"mime": "...",
"fileName": "..."
},
],
"state": "...",
"options": [
"...",
]
}
}
}
Updated 3 months ago