API Reference
Pancake API documentation
List pages
GET
https://pages.fm/api/v1/pages
Pancake Page List
Query Parameters
Name | Type | Description |
---|---|---|
access_token* | String | Pancake user's access token. You can click the link below and click on ADVANCE to get it: |
Generate page access_token
POST
https://pages.fm/api/v1/pages/[:page_id]/generate_page_access_token
Generate/refresh the page's access token
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Customer's Page ID |
access_token* | String | Pancake user's access token. You can click the link below and click on ADVANCE to get it: |
Conversations
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations
Conversation list
Query Parameters
Name | Type | Description |
---|---|---|
page_access_token* | string | Page's token (Can be generated in the TOOLS section in Pancake) |
until* | timestamp | End time (Type: unix in seconds). Time less or equal to one month |
since* | timestamp | Start time (Type: unix in seconds). |
page_id* | string | Customer's Page ID |
page_number* | number | Current page (minimal 1) |
order_by | String | Conversation Order (Default inserted_at) : inserted_at: Creation time updated_at: updated time |
tags | String | ID of the Tags which needs to be filtered Example: 1,2,3,4 (Use the Page List API to get it) |
Conversation tag
POST
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations/[:conversation_id]/tags
Add/remove conversation tag
Path Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Page ID |
page_access_token* | String | Page's token (Can be generated in the TOOLS section in Pancake) |
conversation_id* | String | Conversation ID, you can get this from the Conversation List API |
Request Body
Name | Type | Description |
---|---|---|
action* | String | Action (add: add tag, remove: remove tag) |
tag_id* | String | Tag ID from the Tag list API |
Conversation assignment
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations/[:conversation_id]/assign
Assign an employee to the conversation
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Page ID |
conversation_id* | String | |
page_access_token* | String | Page's token (Can be generated in the TOOLS section in Pancake) |
Request Body
Name | Type | Description |
---|---|---|
assignee_ids* | Array | Employee's ID List to be assigned to the conversation (please see at the User List API) |
Mark read / unread conversation
Mark the conversation as Read/Unread
Mark read
POST
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations/[:conversation_id]/read?page_access_token=[:page_access_token]
Mark unread
POST
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations/[:conversation_id]/unread?page_access_token=[:page_access_token]
Query Parameters
Name | Type | Description |
---|---|---|
| string | page ID |
| string | Conversation ID |
| string | Page's token (Can be generated in the TOOLS section in Pancake) |
Response
{"success": true}
Get Messages
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations/[:conversation_id]/messages
Message list
Query Parameters
Name | Type | Description |
---|---|---|
current_count | number | Used to index the position to get the message. When this is missing while calling the CPI, the system will return the latest 20 messages. If you continue to attach current_count as 25, the system will return 25 older messages from the 20th position. |
page_access_token* | string | Page token (Can be generated in Setting -> Tool) |
customer_id* | string | Customer's ID (From get conversation API below) |
conversation_id* | string | Conversation ID to get the message(From get conversation API below) |
page_id* | string | Page ID to get the data |
Ads statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/pages_campaigns
Advertisement Statistics (You need to login with an account with neccessary permission to see Facebook's ad statistics and choose the page you want before calling this API)
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Page ID |
page_access_token* | String | Page token (Can be generated in Setting -> Tool) |
since* | timestamp | Start time (Type: unix in seconds) |
until* | timestamp | End time (Type: unix in seconds) |
Engagement statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/customer_engagements
Engagement statistics
Query Parameters
Name | Type | Description |
---|---|---|
by_hour | boolean | Statistics by hour |
date_range* | string | Statistics time span (Example: 27/07/2021 00:00:00 - 26/08/2021 23:59:59) |
page_access_token* | string | Page's token (Can be generated in the TOOLS section in Pancake) |
user_ids | String | Employee's ID user list, seperated by , |
Page statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/pages
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Page ID |
page_access_token* | String | Page's token (Can be generated in the TOOLS section in Pancake) |
since* | timestamp | Start time (Type: unix in seconds). |
until* | timestamp | End time (Type: unix in seconds). |
Tag statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/tags
Pancake Tag Statistics
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | page ID |
page_access_token* | String | Page's token (Can be generated in the TOOLS section in Pancake) |
since* | timestamp | Start time (Type: unix in seconds). |
until* | timestamp | End time (Type: unix in seconds). |
Users statatistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/users
User statistics
Query Parameters
Name | Type | Description |
---|---|---|
page_access_token* | string | Page's token (Can be generated in the TOOLS section in Pancake) |
date_range* | string | Time span (Example: 27/07/2021 00:00:00 - 26/08/2021 23:59:59) |
Users statatistics multiple pages
GET
https://pages.fm/api/v1/statistics/user
User statistics in Multiple mode
Query Parameters
Name | Type | Description |
---|---|---|
access_token* | String | Pancake user's access token. You can click the link below and click on ADVANCE to get it: https://pages.fm/account |
page_ids* | String | Page ID list: page_id1,page_id2,... |
date_range* | String | Time span: 05/08/2022 00:00:00 - 06/08/2022 23:59:59 |
New customer statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/customers
New customer statistics by time
Path Parameters
Name | Type | Description |
---|---|---|
group_by | string | Group the data by... fill in one of the following string: - day: (default) group by date - hour: group by date - page_id: group by page |
page_access_token* | string | Page's token (Can be generated in the TOOLS section in Pancake) |
date_range* | string | Time span: 20/07/2020 - 20/08/2020 |
page_id* | string | Customer's page ID |
Page customers
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/page_customers
Customer's Information
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Page ID |
page_access_token* | String | Page's token (Can be generated in the TOOLS section in Pancake) |
since* | timestamp | Start time (type: unix in seconds) |
until* | timestamp | End time (type: unix in seconds) |
page_number* | number | Current page (min: 1) |
page_size | number | Page size (max 100) |
Call logs
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/sip_call_logs
Call list
Path Parameters
Name | Type | Description |
---|---|---|
id* | String | ID call center subscription |
page_access_token* | String | Page's token (Can be generated in the TOOLS section in Pancake) |
page_number* | Number | Current page (minimal 1) |
page_size* | Number | Page length (at least 30) |
since | timestamp | Start time (Type: unix in seconds). |
until | timestamp | End time (Type: unix in seconds). |
page_id* | Number | Page ID |
List tags
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/tags
Danh sách thẻ của trang
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Page ID |
page_access_token* | String | Page's token (Can be generated in the TOOLS section in Pancake) |
Posts
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/posts
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Page ID |
since* | timestamp | Start time (Type: unix in seconds). |
until* | timestamp | End time (Type: unix in seconds). |
page_number* | Number | Current page (minimal 1) |
page_size* | Number | Page length (at least 30) |
page_access_token | String | Page's token (Can be generated in the TOOLS section in Pancake) |
User list
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/users
Get the page's user list
Query Parameters
Name | Type | Description |
---|---|---|
page_id* | String | Page ID |
page_access_token | String | Page's token (Can be generated in the TOOLS section in Pancake) |
Send private reply
POST
https://pages.fm/api/v1pages/[:page_id]/conversations/[:conversation_id]/messages
Used to send an Inbox from a comment. This feature is applicable ONCE only for a comment. Facebook only allows to send an inbox from a comment which was created NO MORE than 7 days ago.
Query Parameters
Name | Type | Description |
---|---|---|
access_token* | string | Pancake user's access token. You can click the link below and click on ADVANCE to get it: |
Headers
Name | Type | Description |
---|---|---|
page_id* | string | Page ID |
conversation_id* | string | Conversation ID which holds the comment |
Request Body
Name | Type | Description |
---|---|---|
post_id* | string | Post ID of the comment |
message_id | string | Comment ID |
action* | string | To send the inbox you need to put |
message* | string | Respond content |
Send inbox
POST
https://pages.fm/api/v1/pages/[:page_id]/conversations/[:conversation_id]/messages
Send the message to the client
Query Parameters
Name | Type | Description |
---|---|---|
access_token* | string | Pancake user's access token. You can click the link below and click on ADVANCE to get it: |
Headers
Name | Type | Description |
---|---|---|
page_id* | string | Page ID |
conversation_id* | string | Conversation ID |
Request Body
Name | Type | Description |
---|---|---|
name | string | File name |
mime_type | string | mime_type of the file(image,...) |
content_url | string | File URL (https://i.ibb.co/mzh7ck8/alaska-beo-acef3fcb1cc541a79048f4bbafed71c8-grande.png) |
attachmentType | string | Attachment type (PHOTO, DOCUMENT) |
action* | string | Set to send the message |
message | string | Content |
thread_key | string | Thread key |
Reply comment
Respond to the customer's comment
Content need to contain at least an image or content
POST
https://pages.fm/api/v1/pages/[:page_id]/conversations/[:conversation_id]/messages
Query Parameters
Name | Type | Description |
---|---|---|
access_token* | string | Pancake user's access token. You can click the link below and click on ADVANCE to get it: |
Headers
Name | Type | Description |
---|---|---|
page_id* | string | Page ID |
conversation_id* | string | Conversation ID |
Request Body
Name | Type | Description |
---|---|---|
action* | string | Set |
message_id | string | Comment ID |
message | string | Content |
content_url | string | File URL (https://i.ibb.co/mzh7ck8/alaska-beo-acef3fcb1cc541a79048f4bbafed71c8-grande.png) |
image_data | string | Data of the file. Needed if content_url is presence. Example: {height: 100, width: 100} |
Last updated