Website chat plugin

Chat plugin is a widget attached to your website that helps customers chat directly to purchase or quickly exchange information about products.

1. Create Pages to manage Website chat

At Dashboard, you click Connect, choose the tab Website and start to create a new page

Here, you input the Page Username, Display name, and profile picture of that page. Then, click Create Page.

  • Page username: The username of the page in the system. You can freely customize the name, but it should not contain spaces, or special characters; and have not existed on the system. For example: Pancake123

  • Display name: The name that is displayed on the system, you can freely customize it.

2. Setup the Page

After creating the page successfully, you select that page and add the domain of your Website.

The system will display a code script of your created page. You can customize the Chat Plugin Button in terms of shape, color, size, and default fields,...

After attaching this script to the <body> of your website, the system will display the Chat Plugin button on your website.

3. API Reference

3.1 Send message

POST https://pages.fm/api/v1/pke_chat_plugin/messages?page_id=[:page_id]

create a new conversation or send a message. Message always contains text or image

Request Body

NameTypeDescription

conversation_id

String

this is the identifier id of the conversation. This id is automatically generated by the system to ensure uniqueness. If left blank, the system will create a new conversation and return the id in response

extra_info

Object

customer information you need to start a conversation example: phone , email, name, custom_field

from_id

String

This id is intended to identify the client sending the message. This id will be automatically generated to ensure uniqueness. If left blank, the system will create new customer and return id in response

images

Array

list of photo urls you want to send

message

String

the content of the message you want to send

name

String

Customer name. If left blank, the lightning system automatically generates

phone

String

Customer's phone number

web_source

String

Determining the origin of the customer's website

page_id

String

this is the identifier id of your page

conversation_id: "web_1664524051101747_web_ZDI0MzYwMWUtNDQ3MS00MTMwLWE2YzEtMjI3Y2EwNmE2MzY4"
dummy_id: 1693022461805
from_id: "web_ZDI0MzYwMWUtNDQ3MS00MTMwLWE2YzEtMjI3Y2EwNmE2MzY4"
id: "web_1664524051101747_MzM3MTMzODEtODZkZS00ZDM0LTllYTUtY2UwMDk2MTY0YjM3"
success: true

3.2 Get messages

GET https://pages.fm/api/v1/pke_chat_plugin/messages

get the message list of the conversation

Query Parameters

NameTypeDescription

conversation_id*

String

this is the identifier id of the conversation. This id is automatically generated by the system to ensure uniqueness.

offset*

Integer

Offset to query message

page_id*

String

this is the identifier id of your page

Headers

NameTypeDescription

String

Request Body

NameTypeDescription

String

String

[
  {
    "attachments": [
      {
        "description": "Phụ kiện thời trang 07 | Webcake",
        "image": {
          "url": "https://content.pancake.vn/1/s1500x950/fwebp/48/c1/5e/fa/d6427653b3fa44d854f2171914c91e090286b98f56448f3101970b11.png"
        },
        "link": "https://netfull.shop/",
        "title": "Phụ kiện thời trang 07 | Webcake",
        "type": "link"
      }
    ],
    "from": {
      "id": "web_ZDI0MzYwMWUtNDQ3MS00MTMwLWE2YzEtMjI3Y2EwNmE2MzY4",
      "name": "Eeo7l"
    },
    "id": "web_1664524051101747_OTEyN2VhMzAtYmRhNy00ZjUxLTk2ZTUtMzZmMGM0Y2UyN2Qy",
    "inserted_at": 1692958958000,
    "message": "dfvasfrasfv"
  },
  {
    "attachments": [],
    "from": {
      "id": "web_ZDI0MzYwMWUtNDQ3MS00MTMwLWE2YzEtMjI3Y2EwNmE2MzY4",
      "name": "Eeo7l"
    },
    "id": "web_1664524051101747_MDIxZWM3NWEtNDVkOS00NmJmLTk4OTAtODZjMzhiMzE4NWI5",
    "inserted_at": 1692959113000,
    "message": "12"
  },
  {
    "attachments": [],
    "from": {
      "id": "web_ZDI0MzYwMWUtNDQ3MS00MTMwLWE2YzEtMjI3Y2EwNmE2MzY4",
      "name": "Eeo7l"
    },
    "id": "web_1664524051101747_ZDAyOTg2ZjYtMzZjNy00NmM4LThkZWUtNDM0MTNmNWJjOGU4",
    "inserted_at": 1693021024000,
    "message": "1"
  }
]

3.3 Connect Web Socket

GET wss://pages.fm/socket/websocket?pke_chat_plugin_page_id=[:page_id]&vsn=2.0.0

Connect web socket to sync message data

Query Parameters

NameTypeDescription

page_id*

String

Your page_id

Last updated