API Reference
Pancake API documentation
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 |
Get Conversations
Query Parameters
Name | Type | Description |
---|---|---|
page_access_token* | string | Page token (can be created in Setting -> Tools) |
until* | timestamp | End time (type unix in seconds). The time should be less or equal to 1 month. |
since* | timestamp | Start time (type unix in seconds). |
page_id* | string | 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 | Tag ID that needs to be filtered. Eg: 1,2,3,4 |
Send comment
POST
https://pages.fm/api/v1/pages/[:page_id]/conversations/[:coversation_id]/messages?access_token=[:access_token]
In order to send responses of comments
Query Parameters
Name | Type | Description |
---|---|---|
access_token | string | The customer's token chain is provided from Pancake |
Headers
Name | Type | Description |
---|---|---|
coversation_id | string | ID conversation you want to answer |
page_id | string | ID your page |
Request Body
Name | Type | Description |
---|---|---|
message | string | Comment content |
parent_id | string | ID comment want to reply |
action | string | To post comments need to set a value |
Send private reply
POST
https://pages.fm/api/v1pages/[:page_id]/conversations/[:conversation_id]/messages?access_token=[:access_token]
In order to send inbox message from comments You can send only one (1) inbox message for one (1) comment. Following Facebook Policy, inbox message from comment is limited inside 7 days window
Query Parameters
Name | Type | Description |
---|---|---|
access_token | string | The customer's token chain is provided from Pancake |
Headers
Name | Type | Description |
---|---|---|
page_id | string | ID your page |
conversation_id | string | ID Conversation contains comments |
Request Body
Name | Type | Description |
---|---|---|
post_id | string | ID the post contains that comment |
message_id | string | ID comment you want to message from that comment |
action | string | To send messages from comments need to set a value |
message | string | Reply content |
Send inbox
POST
https://pages.fm/api/v1/pages/[:page_id]/conversations/[:conversation_id]/messages?access_token=[:access_token]
Send message to customers
Query Parameters
Name | Type | Description |
---|---|---|
access_token | string | The customer's token chain is provided from Pancake |
Headers
Name | Type | Description |
---|---|---|
page_id | string | ID your fanpage |
conversation_id | string | ID conversation |
Request Body
Name | Type | Description |
---|---|---|
name | string | attachment name |
mime_type | string | attachment mime type(image,...) |
content_url | string | attachment url (https://i.ibb.co/mzh7ck8/alaska-beo-acef3fcb1cc541a79048f4bbafed71c8-grande.png) |
attachmentType | string | attachment type (PHOTO) |
action | string | To send messages, a value needs to be set |
message | string | Message content |
thread_key | string | key of conversation want to send message |
New customer statistics
GET
https://pages.fm/api/v1/statistics/partner/customers?page_ids=[:page_ids]&date_range=[:date_range]&group_by=[:group_by]&access_token=[:access_token]
Statistics of new customers over time
Path Parameters
Name | Type | Description |
---|---|---|
group_by | string | Optional data grouping method. Pass one of the following strings: - Day(default): Returns data by date - hour: returns data in an hour - Page_if: Returns data by pages |
access_token | string | The customer's token chain is provided from Pancake |
date_range | string | The time period needs statistics For example: July 20, 2020 - August 20, 2020 |
page_ids | string | ID of one or more pages eg page_id1, page_d2, .. (page_id1, page_id2 is your page ID) |
Customer phone number statistics
GET
https://pages.fm/api/v1/statistics/partner/customers?page_ids=[:page_ids]&date_range=[:date_range]&access_token=[:access_token]
Path Parameters
Name | Type | Description |
---|---|---|
page_number | string | Data retrieval page |
access_token | string | Customer's token chain provided from Pancake |
page_ids | string | ID of 1 or more pages for example: page_id1, page_id2, ... (page_ids1, page_id2 is your page ID) |
date_range | string | Time interval to be statistic For example: July 20, 2019 - August 20, 2019 |
Last updated