TapTalk.io Documentation
  • Introduction
  • OneTalk Omnichannel Documentation
    • Getting Started with OneTalk
      • Team Members
      • Add Topic
      • Assign Agent to Topic
      • Paid Proactive Chat
    • Channel Integration
      • Telegram Integration
      • WhatsApp SME Integration
      • Instagram DM Integration
      • Facebook Messenger Integration
      • Live Chat Integration (iOS, Android, Web)
        • OneTalk Live Chat for Android
          • Get Started
          • Event Listener
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for iOS
          • Get Started
          • Background Process in TapTalk.io Omnichannel iOS
          • Event Delegate
          • Authentication
          • Case & Topic
          • Navigate Live Chat UI
          • Customize UI Appearance
        • OneTalk Live Chat for Web
          • Get Started
          • Callback
          • Method
        • OneTalk Live Chat for React Native
          • Get Started - Android
          • Authentication - Android
          • Get Started - iOS
          • Authentication - iOS
        • OneTalk Live Chat for Flutter
          • Get Started - Android
          • Get Started - iOS
      • Google Business Messages Integration
      • Google Business Profile Integration
      • Tokopedia Integration
    • Integration API
      • Inbox API
      • User/Contact API
    • Live Chat Widget Callback Function
    • Social Channel Button
    • Custom Chatbot Integration
      • Get Started
      • Edit or Delete Chatbot
      • Development
    • QnA via API
    • Webhook
  • PowerTalk Chat SDK Documentation
    • Getting Started with PowerTalk
    • PowerTalk Android
      • Get Started
      • Enable Chat Features
      • Authentication
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Connection
      • Event Listener
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk iOS
      • Get Started
      • TapUI and TapCore
      • Background Process in TapTalk.io
      • Implement Application Delegate
      • Authentication
      • Connection
      • Event Delegate
      • Push Notification
      • General
      • User
      • Room List
        • Room List - TapUI
        • Room List - TapCore
      • Chat Room and Messages
        • Chat Room and Messages - TapUI
        • Chat Room and Messages - TapCore
      • Contact
      • Message Type
      • Customize UI Appearance
      • Customize Chat Features
      • Customize Chat Message Bubble
      • Customize Navigation Bar
      • Deep Linking
      • Error Codes
    • PowerTalk React Native
      • Get Started - Android
      • Get Started - iOS
    • PowerTalk Flutter
      • Get Started - Android
      • Get Started - iOS
    • Javascript SDK
      • Get Started
      • Authentication
      • Connection
      • General
      • Event Listener
      • User
      • Room List
      • Chat Room
      • Messages
      • Contact
      • Message Type
    • Server API
      • Get Started
      • Base URL
      • Authentication
      • User
      • Contact
      • Message
      • Room
    • Webhook
      • Get Started
      • Webhook Payload
  • MeetTalk SDK Documentation
    • Getting Started with MeetTalk
    • MeetTalk Android
      • Get Started
      • Event Listener
    • MeetTalk iOS
      • Get Started
      • Implement Application Delegate
      • Event Delegate
  • SendTalk API Documentation
    • Introduction
    • Whatsapp Verification
Powered by GitBook
On this page
  • Send Custom Message
  • Request
  • Success 200
  • Error 4xx

Was this helpful?

  1. PowerTalk Chat SDK Documentation
  2. Server API

Message

IMPORTANT!

Server Key ID and Server Key Secret will be used to construct a request and add as a HTTP Header. To construct a request, please format your generated Server Key ID and Server Key Secret and wrap it to Base64, so the format will be like this:

encodeToBase64(SERVER_KEY_ID:SERVER_KEY_SECRET) *don't forget to add colon (:) between Server Key ID and Server Key Secret

Then, put the base64 string on your HTTP Header Field with key “Server-Key” and then construct URL request and parameter for the request.

Send Custom Message

Send custom message on behalf of a user to another user.

The following message types are supported:

ID

Description

1001

text

1002

image

2001

products

Other than message types listed above, all custom message types are supported with values of "3xxx" as self-defined by the customer.

IMPORTANT!

If the body or data is too long, the message might be split into multiple messages and sent separately. In case the filterID is not empty, only the last one of the split messages will be visible.

Body & Data Payload The following document describes payload details for data of a message.

For the body, it should only contain text as it is also used as push notification's content.

Note that message's data is always string regardless of the message type, and usually contains JSON string.

1001 - text The data should be empty.

1002 - image The data contains JSON string for the images' details. A message can contain an array of one or more images, each with the following attributes.

Key

Type

Description

url

string

The image URL, to download the image.

mediaType

string

The media type (e.g.: "image/jpeg").

size

integer

The image's size, in bytes.

width

integer

The image's width, in pixels.

height

integer

The image's height, in pixels.

caption

string

The image caption.

2001 - products The data contains JSON string for the products' details. A message can contain an array of one or more products, each with the following attributes.

Key

Type

Description

name

string

The product's name.

imageURL

string

The product's image URL.

description

string

The product's description.

price

string

The price.

currency

string

The price's currency.

rating

string

The product's rating, may be empty.

buttonOption1Text

string

The 1st button's text.

buttonOption1Color

string

The 1st button's color.

buttonOption2Text

string

The 2nd button's text.

buttonOption2Color

string

The 2nd button's color.

BASE_URL/v1/server/message/send/custom

example:
https://taptalk.io/v1/server/message/send/custom

Request

Field

Type

Description

body

string

(104) The text message.

data (optional)

string

(105) The data payload, based on the message type.

filterID (optional)

string

(106) The filter ID.

senderXCUserID

string

(107) The sender's XC user ID.

recipientXCUserID (optional)

string

(108) The recipient's XC user ID.

xcRoomID (optional)

string

(109) The room ID to send to.

Note

Can't use both recipientXCUserID and xcRoomID parameters at the same time in one request. Use recipientXCUserID for sending to personal room type and xcRoomID for sending to other room type.

{
    "messageType": 1001,
    "body": "Hi, nice to meet you.",
    "data": "",
    "filterID": "",
    "senderXCUserID": "1",
    "recipientXCUserID": "6",
    "xcRoomID": ""
}
{
    "messageType": 1001,
    "body": "Hi, nice to meet you.",
    "data": "",
    "filterID": "",
    "senderXCUserID": "1",
    "recipientXCUserID": "",
    "xcRoomID": "6A02C41D"
}
{
    "messageType": 1002,
    "body": "Image",
    "data": "{\"url\":\"http://www.example.com/img/50a09c1b.jpg\",\"mediaType\":\"image/jpeg\",\"size\":131072,\"width\":1280,\"height\":720,\"caption\":\"Look at this picture!\"}",
    "filterID": "products:expert:1",
    "senderXCUserID": "1",
    "recipientXCUserID": "6",
    "xcRoomID": ""
}

Success 200

Field

Type

Description

success

boolean

If the request is successful.

localID

string

The local IDs of the sent message.

{
  "status": 200,
  "error": {
    "code": "",
    "message": "",
    "field": ""
  },
  "data": {
    "success": true,
    "localID": "Uepo3yojSYH4j0rxf8TbMPexgm12k2js"
  }
}

Error 4xx

Name

Description

ParamValidationFailed

The parameter validation failed.

HeaderValidationFailed

The request header validation failed.

{
  "status": 400,
  "error": {
    "code": "40002",
    "message": "Param 'contacts' cannot be empty",
    "field": "101"
  },
  "data": {}
}
{
  "status": 400,
  "error": {
    "code": "40001",
    "message": "Request headers are required (Server-Key)",
    "field": ""
  },
  "data": {}
}
PreviousContactNextRoom

Last updated 2 years ago

Was this helpful?