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

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

Headers

Request Body

[
  {
    "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

Last updated