Post-Purchase Push Notifications

This example demonstrates how to send follow-up messages to users after they complete a checkout process, using Node.js sample code.

Table of Contents


Scenario Overview

After a user completes checkout successfully, follow-up messages can be sent automatically.

For example:

  • Confirm that the order has been placed successfully

  • Provide a link to view the latest order status or purchase history


Get the MantaGO Bot ID

The botId is required for all subsequent API requests and must be included in either the request query parameters or request body.

Example

  1. Open the target bot in the MantaGO Dashboard.

  1. Copy the bot URL:

  1. Extract the string after /chatbot/:

  2. The extracted value is the Bot ID.


Generate (Refresh) API Token and Secret Key

Refer to:

👉 How to Get a Token

to obtain the API Token and Secret Key required for API requests.


If the Token or Secret Key has expired, the following error response will be returned:

You can refresh the API Token and Secret Key using the corresponding API endpoint.

This is the example code to refresh API Token and Secret Key:


Send Broadcast Messages

Once you have:

  • A valid Bot ID

  • A valid API Token

  • A valid Secret Key

you can start sending broadcast messages.

Two types of broadcast content are supported:

  • Plain text messages

  • Conversation modules

Supported platforms include:

  • LINE

  • Facebook Messenger

The following examples demonstrate:

  • Sending a conversation module to a LINE user

Send a Conversation Module to a Specific LINE User

Step 1: Get the Conversation Module ID

Open the conversation module page and copy the URL:

Extract the last segment after /:

This value is the Conversation Module ID.


Step 2: Call the Broadcast API

Use the broadcast API endpoint Broadcast Message to send the conversation module to the target LINE user.

Example Node.js code:


Step 3: Successful Response Example

Step 4: Example Message

After the broadcast is sent successfully, the user will receive a message similar to the following:

Last updated