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}
methodPUT
notesrequested from ChannelTalk to your App Server
Request

header

namenotesrequired
X-SignatureHMAC signature signed using the Signing Keytrue

How to verify X-Signature
  1. Encode the signing key to hexadecimal bytes.
  2. Encode the request body to UTF-8 bytes.
  3. Using the secret key from step one and HMAC SHA-256 function, compute the digest of the value from step two.
  4. Encode the digest to base64.
  5. 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" } } }
fieldtypenotes
methodstringname of the specific feature to call by function (rpc name)
paramsarray or objectfunction body. json data passed by function
contextobjectcontext 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)
fieldtypenotes
channelobjectid: id of the channel where the function was called
callerobjecttype: type of caller | app, user, manager
id: id of caller

Response

Either result or error

fieldtypenotes
resultobject or arrayresponse of successful status code
errorobjectresponse of failing status code

success

{ "result": { ... } }

failure

{ "error": { "type": "..." "message": "..." } }
fieldtypenotes
typestringerror type
messagestringerror 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.

endpointapp-store-api.channel.io/general/v1/apps/{appID}/functions
methodPUT
notescalls the function of a different app installed to the channel
  • Request

    header

    namenotesrequired
    x-access-tokenChannel token issued from Authenticationtrue

    body

    {
      "method": "METHOD_NAME",
      "params": {
        "YOUR_ARGS[0]": "PROVIDED_PARAMS[0]",
        "YOUR_ARGS[1]": "PROVIDED_PARAMS[1]",
        ...
      }
    }
    
    fieldtypenotes
    methodstringname of the specific feature to call by function (rpc name)
    paramsarray or objectfunction body. json data passed by function
  • Response

    Either result or error

    fieldtypenotes
    resultarray or objectresponse of successful status code
    errorobjectresponse of failing status code

    success

    {
      "result": {
        ...
      }
    }
    

    failure

    {
      "error": {
    	  "type": "..."
    	  "message": "..."
      }
    }
    
    fieldtypenotes
    typestringerror type
    messagestringerror 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 .

urlapp-store-api.channel.io/general/v1/native/functions
methodPUT
notescall Native Function offered by ChannelTalk
  • Request

    header

    namenotesrequired
    x-access-tokenChannel token issued from Authenticationtrue

    body

    {
      "method": "METHOD_NAME",
      "params": {
        "YOUR_ARGS[0]": "PROVIDED_PARAMS[0]",
        "YOUR_ARGS[1]": "PROVIDED_PARAMS[1]",
        ...
      }
    }
    
    fieldtypenotes
    methodstringname of the specific feature to call by function (rpc name)
    paramsarray or objectfunction body. json data passed by function
  • Response

    Either result or error

    fieldtypenotes
    resultobjectresponse of successful status code
    errorobjectresponse of failing status code

    success

    {
      "result": {
        ...
      }
    }
    

    failure

    {
      "error": {
    	  "type": "..."
    	  "message": "..."
      }
    }
    
    fieldtypenotes
    typestringerror type
    messagestringerror 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": [ "...", ... ] } } }