Pingtochat Docs

Pingtochat Docs

Did You Know?

Docy turns out that context is a key part of learning.

leafleafleafDocy banner shape 01Docy banner shape 02Man illustrationFlower illustration

Send Single Card Message

Estimated reading: 3 minutes 4 views

Overview

This API allows you to send an RCS message to an individual recipient, using an advance card template. The message can contain a single card with media, buttons, title, and description. It’s ideal for sending rich content, such as promotional offers, product updates, or alerts, to a user’s device.

API Endpoint

POST https://{{your_domain}}/api/v1.0/{{key}}/rcs_message
  • {{your_domain}}: Replace this with your actual domain (e.g., pingtochat.com).
  • {{key}}: Replace this with your API key.

HTTP Method

  • POST: Used to send a message using the provided template.

Headers

  • Content-Type: application/json
  • Authorization: Bearer <your_access_token> Replace <your_access_token> with your actual Bearer token for authentication.

Request Payload

This is the JSON structure used to send the RCS message with a single card template:

Example Request Payload:

{
  "messaging_product": "rcs",
  "recipient_type": "individual",
  "to": "9198xxxxxxxx",
  "type": "advance",
  "template": {
    "name": "basicmessgage",
    "components": [
      {
        "cards": [
          {
            "title": "your_title",
            "description": "your_description",
            "media": {
              "height": "MEDIUM",
              "fileUrl": "https://your_image_path"
            },
            "buttons": [
              {
                "type": "url",
                "text": "link",
                "url": "https://example.com"
              },
              {
                "type": "call",
                "text": "call now",
                "number": "9198xxxxxxxx"
              }
            ]
          }
        ]
      }
    ]
  }
}

Field Description

Field NameTypeDescriptionExample
messaging_productStringSpecifies the messaging product. Set to "rcs" for RCS messaging."rcs"
recipient_typeStringDefines the recipient type. Set to "individual" for sending messages to an individual user."individual"
toStringThe phone number of the recipient. This is where the message will be sent."9198xxxxxxxx"
typeStringDefines the type of the template. For an advanced template, this should be "advance"."advance"
templateObjectContains the template details for the message. Includes the template name and components (e.g., cards).N/A
template.nameStringThe name of the template, used for identification."basicmessage"
template.componentsArrayAn array containing the components of the message (e.g., cards, media, buttons).N/A
template.components.cardsArrayAn array of cards that make up the template. Each card can have a title, description, media, and buttons.N/A
template.components.cards.titleStringThe title of the card, typically a headline or product name."your_title"
template.components.cards.descriptionStringA short description of the card content (e.g., product details, promotional text)."your_description"
template.components.cards.mediaObjectContains media details like image URL and height.N/A
template.components.cards.media.heightStringSpecifies the height of the media. Can be "SMALL", "MEDIUM", or "LARGE"."MEDIUM"
template.components.cards.media.fileUrlStringThe URL of the image or media file that will be displayed in the card."https://your_image_path"
template.components.cards.buttonsArrayAn array of buttons to be included in the card. Each button can be either a URL button or a call button.N/A
template.components.cards.buttons.typeStringThe type of button. It can be "url" (to open a link) or "call" (to initiate a call)."url" or "call"
template.components.cards.buttons.textStringThe text displayed on the button (e.g., “link”, “call now”)."link" or "call now"
template.components.cards.buttons.urlStringThe URL to open when the button type is "url"."https://example.com"
template.components.cards.buttons.numberStringThe phone number to call when the button type is "call"."9198xxxxxxxx"

Success Response

If the message is successfully sent, you will receive a 200 OK HTTP status, along with details about the sent message.

Example Response:

{
    "status": "success",
    "message": "Message send successfully",
    "transaction_id": "abvXXXXXXXXX"
}

Leave a Comment

Share this Doc

Send Single Card Message

Or copy link

CONTENTS