API Reference
Tài liệu Pancake API
List pages
GET
https://pages.fm/api/v1/pages
Danh sách trang
Query Parameters
Generate page_access_token
POST
https://pages.fm/api/v1/pages/[:page_id]/
generate_page_access_token
Tạo hoặc làm mới page_access_token
Query Parameters
Conversations
{
"conversations": [{
"page_id": "wa_c.us@84328290781",
"customer_id": "72bea3ea-722a-4e33-b415-2b2281f44724",
"assignee_histories": [{
"conversation_id": "wa_84328290781@c.us_62818166016@c.us",
"inserted_at": "2021-08-26T06:29:56",
"payload": {
"added_users": [{
"email": "phamdongtx@gmail.com",
"fb_id": "1831989023699268",
"id": "82be33ea-729a-4e83-be15-2b7c83f34724",
"name": "Pham Dong"
}],
"deleted_users": []
}
}],
"type": "INBOX",
"inserted_at": "2021-08-26T06:29:56",
"tags": [],
"recent_phone_numbers": [],
"customers": [{
"avatar_url": "84328290781@c.us_1621224114",
"fb_id": "wa_c.us@62818166016",
"id": "d8526c77-832a-425c-8aee-e5d7dfcd7cd0",
"name": "Babywearit (+62 81 816 6016)"
}],
"has_phone": false,
"tag_histories": [],
"post_id": null,
"id": "wa_84328290781@c.us_62818166016@c.us",
"last_sent_by": {
"avatar_url": "84328290781@c.us_1621224114",
"id": "wa_c.us@62818166016",
"name": "Babywearit (+62 81 816 6016)",
"phone_number": "62818166016"
},
}],
"success": true
}
Chú thích
"conversations": Danh sách hội thoại
Chi tiết hội thoại:
"page_id": id trang
"customer_id": id khách hàng
"assignee_histories": Lịch sử phân công hội thoại
"type": Kiểu hội thoại(INBOX, COMMENT, RATING)
"inserted_at": Thời tạo hội thoại
"tags": Tag hiện tại được gắn
"recent_phone_numbers": Số điện thoại của hội thoại
"customers": Thông tin khách hàng
"has_phone": Có số điện thoại hay không
"tag_histories": Lịch sử gắn gỡ tag
"post_id": ID bài post nếu là comment
"last_sent_by": Người gửi tin nhắn
"current_assign_users": Danh sách phần công thời điểm hiện tại
"ad_ids": Danh sách ad_id
Internal Server Error
Tag conversation
POST
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations/[:conversation_id]/tags
Thêm gỡ thẻ hội
Path Parameters
Request Body
{
"data": [ // Danh sách thẻ hiện sau khi update
0,
1,
2,
4,
5
],
"success": true,
"timestamp": 1652845231603964 // Thời điểm thao tác
}
{
"success": false,
"message": "page_id is required!"
}
Conversation assignment
POST
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations/[:conversation_id]/assign
Phân công nhân viên vào hội thoại
Query Parameters
Request Body
{
"assignee_group_id": "2",
"assignee_ids": [
"3fadfd70-1ead-4a16-a456-1fa007e38e5c",
"6aa49b8e-c554-44e4-81ba-c50a2d5b51b3",
"28f4673e-14f2-4556-840d-7aae58e9b8ed"
],
"customers": [
{
"fb_id": "2810250135746666",
"id": "03996852-8fa6-4ae9-b2d0-d95bd67d9d8e",
"name": "Quyết Nguyễn"
}
],
"from": {
"email": "2810250135746666@facebook.com",
"id": "2810250135746666",
"name": "Quyết Nguyễn"
},
"from_psid": "2810250135746666",
"has_phone": true,
"id": "110699180573884_2810250135746666",
"inserted_at": "2020-07-11T09:02:30",
"is_combined": false,
"is_removed": false,
"last_customer_interactive_at": "2023-04-05T02:21:57",
"last_sent_by": {
"admin_id": "570423649807405",
"admin_name": "Quyết Nguyễn",
"id": "110699180573884",
"name": "MemeViet"
},
"message_count": 584,
"page_id": "110699180573884",
"post_id": null,
"read_watermarks": [
{
"message_id": "m_ffBfntulf9g2vp6pR7YwsKeDRTqVhl7NbvRZnivNqM6Ne5MDNuQ0joWh0hV_vkZpeR3ufBRiwFcHlvl-Ru4csg",
"psid": "2810250135746666",
"watermark": 1680661734
}
],
"recent_phone_numbers": [
{
"captured": "0328290781",
"length": 10,
"m_content": "0328290781",
"m_id": "m_8RFElPVHVrjAQU6873W5NqeDRTqVhl7NbvRZnivNqM7Pix1jcT6D8wAqt-Iz4hQrd00MZ5wSSCbA_nJ2GXKOEQ",
"offset": 0,
"phone_number": "0328290781",
"status": 1
},
{
"captured": "0812997207",
"length": 10,
"m_content": "0812997207",
"m_id": "m_dLjh8RpYYE0ArTATcXnsuKeDRTqVhl7NbvRZnivNqM5XGk23-yiMFXeRa-Cxb786YiyNbIQVNnSB9Y6Ou0OsRw",
"offset": 0,
"phone_number": "0812997207",
"status": 0
},
{
"captured": "0328290798",
"length": 10,
"m_content": "0328290798",
"m_id": "m_4-wlt-8bPT8zXzsJlf-U26eDRTqVhl7NbvRZnivNqM66wsnYisL2VAL-yJOv5hrQf5K9dIbKA84Jf4ZcaVghpA",
"offset": 0,
"phone_number": "0328290798",
"status": 0
},
{
"captured": "0328290799",
"length": 10,
"m_content": "0328290799",
"m_id": "m_WmdnGmAIuYBVRREPw82Sr6eDRTqVhl7NbvRZnivNqM5_PmAyAZ-qAQjuyF_CKt76PA6MNbDbp663uf3LQfSAcg",
"offset": 0,
"phone_number": "0328290799",
"status": 2
},
{
"captured": "0328290781",
"length": 10,
"m_content": "0328290781",
"m_id": "m_GnlF3xzsH_I9UKSttrEeRqeDRTqVhl7NbvRZnivNqM4Qh9eoZuPTPCPRSutyxWHyF85M5gEeHW2c0yfpl5FsHA",
"offset": 0,
"phone_number": "0328290781",
"status": 1
}
],
"recent_seen_users": [
{
"fb_id": "570423649807405",
"fb_name": "Quyết Nguyễn",
"seen_at": "2023-04-05T02:22:06.689494"
}
],
"seen": true,
"snippet": "[Photo]",
"success": true,
"tags": [
-99,
1,
26,
28,
29,
30,
31,
32,
35,
36,
39,
40,
41,
42,
43,
44,
45
],
"thread_id": "159952432315225",
"thread_key": "t_1495217373994690",
"type": "INBOX",
"unread_count": 0,
"updated_at": "2023-04-06T04:31:45"
}
Mark read / unread conversation
Đánh dấu hội thoại thành đã đọc hoặc chưa đọc.
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
Response
{"success": true}
Get messages
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/conversations/[:conversation_id]/messages
Danh sách tin nhắn
Query Parameters
{
"messages": [
{
"attachments": [], // Media của tin nhắn
"conversation_id": "256469571178082_3100878013328342", // ID hội thoại
"from": { // Thông tin khách hàng
"email": "3100878013328342@facebook.com",
"id": "3100878013328342",
"name": "Quyết Nguyễn"
},
"has_phone": false, // Có chứa số điện thoại không
"id": "m_Ec_f7RJrKyJlRKXVdEYW5gWswhac17zNH0kIRGkMGhuBkqMkamKpUyJSpemXfRB0kULuVY8WA-ATEthHwher9g", // ID tin nhắn
"inserted_at": "2023-12-26T08:44:29.000000", // Thời gian tạo tin nhắn
"is_hidden": false, // Đã ẩn hay chưa chỉ dùng cho comment
"is_livestream_order": null,
"is_parent": false, // Có phải comment cha không chỉ dùng cho comment
"is_parent_hidden": false, // Comment cha đã bị ẩn chưa chỉ dùng cho comment
"is_removed": false, // Đã bị xoá chưa
"like_count": null, // Số lượt like chỉ dùng cho comment
"message": "asda", // Nội dung tin nhắn
"page_id": "256469571178082", // ID của trang
"phone_info": [], // Thông tin số điện thoại có trong tin nhắn
"type": "INBOX", // Loại tin nhắn [INBOX, COMMEMNT, RATING]
}
],
"success": true
}
Ads statistics
Campaign
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/pages_campaigns
Thống kê chiến dịch quảng cáo(bạn cần đăng nhập tài khoản có quyền xem báo cáo quảng cáo ở Facebook trước khi gọi api)
Query Parameters
[
{
"account_id": "11112430409201147",
"ad_id": "2384887411112310288",
"adset_id": "2312324572270288",
"budget_remaining": "3000",
"cpc": null,
"cpm": null,
"ctr": null,
"currency": "USD",
"daily_budget": "3000",
"impressions": null,
"lifetime_budget": "0",
"link_click": null,
"messaging_conversation_started_7d": null,
"messaging_first_reply": null,
"name": "QC FB thúc đẩy doanh thu",
"post_comments": null,
"purchase_roas": null,
"purchases": null,
"purchases_conversion_value": null,
"reach": null,
"spend": null,
"status": "PAUSED"
}
]
Ads
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/ads
Thống kê quảng cáo(bạn cần đăng nhập tài khoản có quyền xem báo cáo quảng cáo ở Facebook trước khi gọi api)
Query Parameters
[
{
"account_id": "11112430409201147",
"ad_id": "2384887411112310288",
"adset_id": "2312324572270288",
"budget_remaining": "3000",
"cpc": null,
"cpm": null,
"ctr": null,
"currency": "USD",
"daily_budget": "3000",
"impressions": null,
"lifetime_budget": "0",
"link_click": null,
"messaging_conversation_started_7d": null,
"messaging_first_reply": null,
"name": "QC FB thúc đẩy doanh thu",
"post_comments": null,
"purchase_roas": null,
"purchases": null,
"purchases_conversion_value": null,
"reach": null,
"spend": null,
"status": "PAUSED"
}
]
Engagement statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/customer_engagements
Thống kê tương tác
Query Parameters
{
"data": {
"categories": ["26/8", "25/8", "24/8", "23/8", "22/8", "21/8", "20/8", "19/8", "18/8", "17/8", "16/8", "15/8", "14/8", "13/8", "12/8", "11/8", "10/8", "9/8", "8/8", "7/8", "6/8", "5/8", "4/8", "3/8", "2/8", "1/8", "31/7", "30/7", "29/7", "28/7", "27/7"],
"series": [{
"data": [0, 0, 2, 1, 0, 0, 1, 2, 2, 0, 3, 0, 3, 2, 0, 0, 6, 2, 0, 0, 0, 2, 1, 0, 0, 0, 0, 6, 1, 3, 1],
"name": "inbox"
}, {
"data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"name": "comment"
}, {
"data": [0, 0, 2, 1, 0, 0, 1, 2, 2, 0, 3, 0, 3, 2, 0, 0, 6, 2, 0, 0, 0, 2, 1, 0, 0, 0, 0, 6, 1, 3, 1],
"name": "total"
}, {
"data": [0, 0, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 1, 1],
"name": "new_customer_replied"
}, {
"data": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"name": "customer_engagement_new_inbox"
}]
},
"success": true
}
Chú thích:
categories: danh sách ngày thống
series: Dữ liệu thống kê
series.data: Dữ liệu thống kê theo ngày tương ứng với danh sách categories
series.name: Kiểu thống kê
"inbox": Tương tác tin nhắn
"comment": Tương tác comment
"total": Tổng tương tác tin nhắn và
"new_customer_replied": Tương tác khách hàng
"customer_engagement_new_inbox": Hội thoại khách hàng
by_hour:
{
"statistics": [{
"comment": 0,
"hour": "2021-08-26T13:00:00",
"inbox": 1,
"new_customer": 0,
"new_customer_from_inbox": 0,
"total": 1
}, {
"comment": 0,
"hour": "2021-08-26T10:00:00",
"inbox": 1,
"new_customer": 0,
"new_customer_from_inbox": 0,
"total": 1
}],
"success": true
}
Internal Server Error
Page statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/pages
Query Parameters
{
// Response
}
{
"data": [{
"customer_comment_count": 0, Bình luận bởi khách hàng
"customer_inbox_count": 0, Tin nhắn từ khách hàng
"hour": "2021-04-01T12:00:00", Thời gian
"inbox_interactive_count": 0, Số khách cũ nhắn tin tương tác lại
"new_customer_count": 0, Khách hàng mới
"new_inbox_count": 0, Số hội thoại tin nhắn mới
"page_comment_count": 0, Bình luận bởi trang
"page_inbox_count": 2, Tin nhắn bởi trang
"phone_number_count": 0, Số điện thoại trong ngày
"today_uniq_website_referral": 0, Số lượt khách từ website (có đăng nhập)
"today_website_guest_referral": 0, Số lượt khách từ website (Không đăng nhập)
"uniq_phone_number_count": 0 Số điện thoại mới
}, {
"customer_comment_count": 0,
"customer_inbox_count": 2,
"hour": "2021-04-01T14:00:00",
"inbox_interactive_count": 0,
"new_customer_count": 0,
"new_inbox_count": 0,
"page_comment_count": 0,
"page_inbox_count": 3,
"phone_number_count": 0,
"today_uniq_website_referral": 0,
"today_website_guest_referral": 0,
"uniq_phone_number_count": 0
}],
"success": true
}
Tag statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/tags
Thống kê thẻ hội thoại
Query Parameters
{
// Response
}
{
"data": {
"categories": ["05/04", "06/04", "07/04", "14/04", "15/04", "28/04"], Thời
"series": {
"tag_194": [0, 0, 0, 0, 0, 0], ID thẻ/Tổng số lần gắn gỡ thẻ
"tag_235": [0, 0, 0, 0, 0, 0],
"tag_239": [0, 0, 0, 0, 0, 0],
"tag_236": [0, 0, 0, 0, 0, 0],
"tag_226": [0, 0, 0, 0, 0, 0],
"tag_197": [0, 0, 0, 1, 0, 0],
"tag_244": [0, 0, 0, 0, 0, 0],
"tag_229": [0, 0, 0, 0, 0, 0],
"tag_183": [0, 0, 0, 0, 0, 1],
"tag_224": [0, 0, 0, 0, 0, 0],
"tag_240": [0, 0, 0, 0, 0, 0],
"tag_188": [2, 0, 0, 0, 0, 0],
"tag_216": [0, 0, 0, 0, 0, 0],
"tag_228": [0, 0, 0, 0, 0, 0],
"tag_230": [0, 0, 0, 0, 0, 0],
"tag_220": [0, 0, 0, 0, 0, 0],
"tag_222": [0, 0, 0, 0, 0, 0],
"tag_202": [0, 0, 0, 1, 0, 0],
"tag_237": [0, 0, 0, 0, 0, 0],
"tag_241": [0, 0, 0, 0, 0, 0],
"tag_249": [0, 0, 0, 0, 0, 0],
"tag_219": [0, 0, 0, 0, 0, 0],
"tag_186": [0, 0, 0, 0, -1, 0],
"tag_227": [0, 0, 0, 0, 0, 0],
"tag_246": [0, 0, 0, 0, 0, 0],
"tag_195": [0, 0, 0, 0, 0, 1],
"tag_231": [0, 0, 0, 0, 0, 0],
"tag_221": [0, 0, 0, 0, 0, 0],
"tag_251": [0, 0, 0, 0, 0, 0],
"tag_245": [0, 0, 0, 0, 0, 0],
"tag_250": [0, 0, 0, 0, 0, 0],
"tag_193": [0, 0, 0, 0, 0, 0],
"tag_190": [0, 0, 0, 0, 0, 0],
"tag_223": [0, 0, 0, 0, 0, 0],
"tag_225": [0, 0, 0, 0, 0, 0],
"tag_218": [0, 0, 0, 0, 0, 0],
"tag_248": [0, 0, 0, 0, 0, 0],
"tag_187": [0, 0, 0, 0, 0, 0],
"tag_189": [1, 0, 0, 0, 0, 0],
"tag_199": [0, 0, 0, 0, 0, 0],
"tag_196": [1, 1, 4, 0, 2, 0],
"tag_233": [0, 0, 0, 0, 0, 0],
"tag_234": [0, 0, 0, 0, 0, 0],
"tag_232": [0, 0, 0, 0, 0, 0],
"tag_238": [0, 0, 0, 0, 0, 0],
"tag_243": [0, 0, 0, 0, 0, 0]
}
},
"data_today": {
"categories": [],
"series": {
"tag_235": [],
"tag_239": [],
"tag_236": [],
"tag_226": [],
"tag_244": [],
"tag_229": [],
"tag_224": [],
"tag_240": [],
"tag_216": [],
"tag_228": [],
"tag_230": [],
"tag_220": [],
"tag_222": [],
"tag_237": [],
"tag_241": [],
"tag_249": [],
"tag_219": [],
"tag_227": [],
"tag_246": [],
"tag_231": [],
"tag_221": [],
"tag_251": [],
"tag_245": [],
"tag_250": [],
"tag_223": [],
"tag_225": [],
"tag_218": [],
"tag_248": [],
"tag_233": [],
"tag_234": [],
"tag_232": [],
"tag_238": [],
"tag_243": []
}
},
"success": true,
"tags": [{ Danh sách thẻ
"color": "#e39a6a",
"id": "tag_216",
"lighten_color": "rgba(227,154,106,0.4)",
"text": "this a a testse"
}, {
"color": "#3882c1",
"id": "tag_218",
"lighten_color": "rgba(56,130,193,0.4)",
"text": "Chờ kiểm tra"
}, {
"color": "#055d53",
"id": "tag_219",
"lighten_color": "rgba(5,93,83,0.4)",
"text": "AdCake"
}, {
"color": "#796167",
"id": "tag_220",
"lighten_color": "rgba(121,97,103,0.4)",
"text": "Instagram"
}, {
"color": "#29eb00",
"id": "tag_221",
"lighten_color": "rgba(41,235,0,0.4)",
"text": "WebCake"
}, {
"color": "#77149e",
"id": "tag_222",
"lighten_color": "rgba(119,20,158,0.4)",
"text": "Shopee"
}, {
"color": "#b1660d",
"id": "tag_223",
"lighten_color": "rgba(177,102,13,0.4)",
"text": "App Mobile"
}, {
"color": "#090d17",
"id": "tag_224",
"lighten_color": "rgba(9,13,23,0.4)",
"text": "POS"
}, {
"color": "#880909",
"id": "tag_225",
"lighten_color": "rgba(136,9,9,0.4)",
"text": "Tổng đài"
}, {
"color": "#ff3033",
"id": "tag_226",
"lighten_color": "rgba(255,48,51,0.4)",
"text": "extension"
}, {
"color": "#3f7b4f",
"id": "tag_227",
"lighten_color": "rgba(63,123,79,0.4)",
"text": "Sales"
}, {
"color": "#0d5aff",
"id": "tag_228",
"lighten_color": "0",
"text": "GHTK"
}, {
"color": "#d89cc9",
"description": "Lỗi ghi chú",
"id": "tag_229",
"lighten_color": "rgba(216,156,201,0.4)",
"text": "Lỗi ghi chú"
}, {
"color": "#ff6d6d",
"description": "Thẻ này dành cho Đông dz",
"id": "tag_230",
"lighten_color": "rgba(255,109,109,0.4)",
"text": "Đông Đông"
}, {
"color": "#0e2f44",
"id": "tag_231",
"lighten_color": "rgba(14,47,68,0.4)",
"text": "lỗi ảnh"
}, {
"color": "#4b5577",
"id": "tag_232",
"lighten_color": "rgba(75,85,119,0.4)",
"text": "Xoay vòng"
}, {
"color": "#9bcede",
"id": "tag_233",
"lighten_color": "rgba(155,206,222,0.4)",
"text": "Lỗi tìm kiếm"
}, {
"color": "#ffdf13",
"id": "tag_234",
"lighten_color": "rgba(255,223,19,0.4)",
"text": "Lỗi ava"
}, {
"color": "#8e708b",
"id": "tag_235",
"lighten_color": "rgba(142,112,139,0.4)",
"text": "Tính năng mới"
}, {
"color": "#e51dff",
"id": "tag_236",
"lighten_color": "rgba(229,29,255,0.4)",
"text": "Lỗi chờ"
}, {
"color": "#30fff3",
"id": "tag_237",
"lighten_color": "rgba(48,255,243,0.4)",
"text": "Báo lại khách"
}, {
"color": "#b1b00d",
"description": "Tag này dành cho những câu hỏi hóc búa liên quan đến Botcake. Mọi người gắn thẻ anh Hải CT (Hải béo) nha",
"id": "tag_238",
"lighten_color": "rgba(177,176,13,0.4)",
"text": "Hải CT"
}, {
"color": "#44240e",
"id": "tag_239",
"lighten_color": "rgba(68,36,14,0.4)",
"text": "thiếu quyền"
}, {
"color": "#1550c6",
"id": "tag_240",
"lighten_color": "rgba(21,80,198,0.4)",
"text": "Đã giải quyết"
}, {
"color": "#ff6d6d",
"id": "tag_241",
"lighten_color": "rgba(255,109,109,0.4)",
"text": "Thẻ 26"
}, {
"color": "#38a6f4",
"id": "tag_243",
"lighten_color": "rgba(56,166,244,0.4)",
"text": "Tín Ngô"
}, {
"color": "#822ba1",
"id": "tag_244",
"lighten_color": "rgba(130,43,161,0.4)",
"text": "Thái Lan"
}, {
"color": "#4b595e",
"id": "tag_245",
"lighten_color": "rgba(75,89,94,0.4)",
"text": " this is a test"
}, {
"color": "#4b595e",
"id": "tag_246",
"lighten_color": "rgba(75,89,94,0.4)",
"text": "Thẻ 31"
}, {
"color": "#1550c6",
"id": "tag_248",
"lighten_color": "rgba(21,80,198,0.4)",
"text": "Thẻ 32"
}, {
"color": "#178989",
"id": "tag_249",
"lighten_color": "rgba(23,137,137,0.4)",
"text": "test1"
}, {
"color": "#009344",
"id": "tag_250",
"lighten_color": "rgba(0,147,68,0.4)",
"text": "test2"
}, {
"color": "#4b5577",
"id": "tag_251",
"lighten_color": "rgba(75,85,119,0.4)",
"text": "test3"
}]
}
Users statatistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/users
Thống kê nhân viên
Query Parameters
{
"data": {
"statistics": {
"c5a50cce-fb0a-4eb3-892a-74ad182f7c03": [{
"average_response_time": 3376234,
"comment_count": 0,
"hour": "2021-07-27T09:00:00",
"inbox_count": 2,
"phone_number_count": 0,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 1
}, {
"average_response_time": 74276,
"comment_count": 0,
"hour": "2021-07-28T10:00:00",
"inbox_count": 6,
"phone_number_count": 0,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 2
}]
},
"users": {
"c5a50cce-fb0a-4eb3-892a-74ad182f7c03": {
"average_response_time": 588569,
"comment_count": 0,
"hour": "2021-08-26T13:00:00",
"inbox_count": 637,
"phone_number_count": 0,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 30,
"user_fb_id": "570423649807405",
"user_name": "Quyết Nguyễn"
}
}
},
"success": true
}
Chú thích:
"statistics": Thống kê theo thời gian
"users": Thống kê theo nhân viên
"average_response_time": Thời gian phản hổi trung
"comment_count": Tổng số bình luận thực
"inbox_count": Tổng số tin nhắn thực
"phone_number_count": Tổng số điện thoại
"private_reply_count": "Hành động gửi tin nhắn từ bình luận",
"unique_comment_count": Phản hồi cho mỗi bình luận của khách hàng (Thường bằng số bình luận của khách hàng)
"unique_inbox_count": Phản hồi cho mỗi tin nhắn của khách hàng (Thường bằng số lượng tin nhắn của khách hàng)
"hour": Thời gian thống kê
"user_name": Tên nhân viên
"user_fb_id": facebook id của nhân
Internal Server Error
Users statatistics multiple pages
GET
https://pages.fm/api/v1/statistics/user
Thống kê nhân viên chế độ gộp
Query Parameters
{
"statistics": { #Thống kê theo thời gian
"2138b20a-6745-4fe2-91b2-f75e6c43b7b0": [
{
"average_response_time": 10, #Thời gian phản hổi trung bình
"comment_count": 0, #Số comment đã trả lời
"hour": "2022-07-05T01:00:00", #Thời gian
"inbox_count": 1, #Số tin nhắn đã trả lời
"order_count": 0, #Số đơn hàng đã chốt
"phone_number_count": 0, #Số điện thoại mang về
"private_reply_count": 0, #Số tin nhắn từ bình luận
"unique_comment_count": 0, #Số phiên trả lời bình luận
"unique_inbox_count": 1 #Số phiên trả lời tin nhắn
}
],
"3fadfd70-1ead-4a16-a456-1fa007e38e5c": [
{
"average_response_time": 0,
"comment_count": 0,
"hour": "2022-07-05T12:00:00",
"inbox_count": 0,
"order_count": 0,
"phone_number_count": 1,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 0
}
],
"6350389d-7bd6-4e3f-8a0b-a370d76f63fd": [
{
"average_response_time": 34389,
"comment_count": 0,
"hour": "2022-07-05T12:00:00",
"inbox_count": 10,
"order_count": 0,
"phone_number_count": 0,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 1
},
{
"average_response_time": 0,
"comment_count": 0,
"hour": "2022-07-07T09:00:00",
"inbox_count": 0,
"order_count": 0,
"phone_number_count": 1,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 0
}
]
},
"users": { #Thống kê theo nhân viên
"2138b20a-6745-4fe2-91b2-f75e6c43b7b0": {
"average_response_time": 10,
"comment_count": 0,
"hour": "2022-07-05T01:00:00",
"inbox_count": 1,
"order_count": 0,
"phone_number_count": 0,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 1,
"user_fb_id": "1079158022137261",
"user_name": "Khoa 12 12 tv1234567.1"
},
"3fadfd70-1ead-4a16-a456-1fa007e38e5c": {
"average_response_time": 0,
"comment_count": 0,
"hour": "2022-07-05T12:00:00",
"inbox_count": 0,
"order_count": 0,
"phone_number_count": 1,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 0,
"user_fb_id": "2378637269074943",
"user_name": "Duc Nguyen"
},
"6350389d-7bd6-4e3f-8a0b-a370d76f63fd": {
"average_response_time": 34389,
"comment_count": 0,
"hour": "2022-07-07T09:00:00",
"inbox_count": 10,
"order_count": 0,
"phone_number_count": 1,
"private_reply_count": 0,
"unique_comment_count": 0,
"unique_inbox_count": 1,
"user_fb_id": "1751542581753690",
"user_name": "Bùi Văn Long"
}
}
}
{
// Response
}
New customer statistics
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/statistics/customers
Thống kê khách hàng mới theo thời gian
Path Parameters
no group_by
{
"data":[
{"date":"2020-08-27","new_customer_count":0,"new_page_inbox_count":1,"new_phone_number_count":0,"phone_number_count":0},
{"date":"2020-08-24","new_customer_count":0,"new_page_inbox_count":2,"new_phone_number_count":0,"phone_number_count":0},
{"date":"2020-08-12","new_customer_count":4,"new_page_inbox_count":3,"new_phone_number_count":0,"phone_number_count":0}
],
"success":true
}
group_by: page_id
{
"data": {
"103205717747769": [
{"date":"2020-08-12","new_customer_count":0,"new_page_inbox_count":1,"new_phone_number_count":0,"phone_number_count":0}
],
"110699180573884":[
{"date":"2020-08-27","new_customer_count":0,"new_page_inbox_count":2,"new_phone_number_count":0,"phone_number_count":0}
]
},
"success":true
}
group_by: hour
{
"data":[
{"date":"2020-08-12T16:00:00","new_customer_count":0,"new_page_inbox_count":1,"new_phone_number_count":0,"phone_number_count":0},
{"date":"2020-08-12T17:00:00","new_customer_count":0,"new_page_inbox_count":2,"new_phone_number_count":0,"phone_number_count":0},
{"date":"2020-08-12T18:00:00","new_customer_count":4,"new_page_inbox_count":3,"new_phone_number_count":0,"phone_number_count":0}
],
"success":true
}
"Server internal error"ustomer phone number
Page customers
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/page_customers
Thông tin khách hàng
Query Parameters
{
"total": 500,
"customers": [{
"birthday": null,
"gender": null,
"inserted_at": "2021-06-07T11:11:16",
"name": "Tạ Tuấn Vũ",
"phone_numbers": [],
"psid": "3296946846995244",
"notes": [{
"created_at": 1665981253137,
"created_by": {
"fb_id": "108877101230501",
"fb_name": "Dat Phung",
"uid": "efcd17d6-b4ff-4f6d-bf09-583db63a7bba"
},
"edit_history": [],
"id": "803c638a-2767-43d6-9892-2f06c43cb1df",
"images": [],
"links": [],
"message": "note 1",
"order_id": "983902035",
"removed_at": null,
"updated_at": null
}]
}, {
"birthday": null,
"gender": "male",
"inserted_at": "2021-06-07T11:11:09",
"lives_in": "Hà Nội",
"name": "Quyết Nguyễn",
"phone_numbers": [],
"psid": "2810250135746666",
"notes": []
}, {
"birthday": null,
"gender": null,
"inserted_at": "2021-03-27T16:55:33",
"lives_in": "Hà Nội",
"name": "Quyết Nguyễn",
"phone_numbers": [],
"psid": "1472648309584930",
"notes": []
}],
"success": true
}
{
"message": "until is required!",
"success": false
}
{
// Response
}
{
"error_code": 102,
"message": "Invalid access_token",
"success": false
}
Call logs
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/sip_call_logs
Danh sách cuộc gọi
Path Parameters
{
"call_logs": [{
"answered_time": null, #Thời gian
"client_hangup": false,
"client_type": "pos",
"created_time": "2022-03-31T04:03:34", #Thời gian thực
"direction": "outbound",
"employee_name": "Hưởng Ngô(670751739744664)", # Nhân viên thực hiện
"hangup_time": "2022-03-31T04:03:41",
"phone_number": "0899293662", #Số điện
"record_file": null, #File ghi
"type": "hangup" #Loại cuộc
}, {
"answered_time": null,
"client_hangup": false,
"client_type": "pos",
"created_time": "2022-03-29T16:43:55",
"direction": "outbound",
"employee_name": "Hưởng Ngô(670751739744664)",
"hangup_time": "2022-03-29T16:44:05",
"phone_number": "0985215395",
"record_file": null,
"type": "hangup"
}],
"success": true
}
{
{"message":" is required!","success":false}
}
List tags
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/tags
Danh sách thẻ của trang
Query Parameters
{
"tags": [
{
"color": "#4b5577",
"id": 0,
"lighten_color": "#c9ccd6",
"text": "Kiểm hàng"
},
{
"color": "#822ba1",
"id": 1,
"lighten_color": "#d9bfe2",
"text": "Câu hỏi"
},
{
"color": "#0d5aff",
"id": 2,
"lighten_color": "#b6cdff",
"text": "Mua hàng"
},
{
"color": "#009344",
"id": 3,
"lighten_color": "#b2dec6",
"text": "Đã gửi"
},
{
"color": "#38a6f4",
"id": 4,
"lighten_color": "#c3e4fb",
"text": "Hết hàng"
},
{
"color": "#bd2727",
"id": 5,
"lighten_color": "#ebbebe",
"text": "Trả hàng"
}
]
}
Posts
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/posts
Query Parameters
{
"success": true,
"posts": [
{
"admin_creator": null,
"attachments": null,
"comment_count": 0,
"delete_comment": false,
"from": {
"id": "5460527857372996",
"name": "Djamel Belkessa"
},
"hide_comment": null,
"id": "256469571178082_1719461745119729",
"ignore_comment": false,
"inserted_at": "2022-08-22T03:09:27",
"is_removed": false,
"like_count": 0,
"link": null,
"live_video_status": null,
"message": "edit review là 1 nghệ thuật",
"page_id": "256469571178082",
"phone_number_count": 0,
"privacy": null,
"status_type": "rating",
"story": null,
"type": "rating"
}
],
"total": 200
}
User list
GET
https://pages.fm/api/public_api/v1/pages/[:page_id]/users
Danh sách người dùng của trang
Query Parameters
{
"success": true,
"users": [
{
"email": null,
"id": "3740ef68-cd6c-45f9-96c3-94d3f2665f87",
"name": "Dinh Kaito"
},
{
"email": "purification1997@gmail.com",
"id": "ed6264a7-882b-42f6-8ace-ae617cd60b0d",
"name": "Đức Nguyễn"
},
{
"email": "ntq97thhust@gmail.com",
"id": "f13655aa-a748-4ace-aacf-f2443581865c",
"name": "Quyết Nguyễn"
},
{
"email": "kaidodinh@gmail.com",
"id": "1443760a-bb76-4666-9175-bd492801d506",
"name": "Dinh Kaito"
}
]
}
Send private reply
POST
https://pages.fm/api/v1pages/[:page_id]/conversations/[:conversation_id]/messages
Dùng để gửi tin nhắn từ bình luận Gửi tin nhắn từ bình luận chỉ gửi được một lần duy nhất cho một comment. Theo quy định của Facebook chỉ gửi được tin nhắn cho bình luận được tạo không quá 7 ngày.
Query Parameters
Headers
Request Body
{
"id": "m_5js02va40Z7Z5wUp2aPdbdmaxJ0QidmArUGPAjhej4U3LfA7WGMI62EL5qtJE_1FRXMtVlbDLd9dmmaIR5-ZAw",
"success": true
}
{
"id_private_reply": "t_1441476025946663",
"message": "(#10900) Activity already replied to",
"message_code": 10900,
"success": false
}
"Server internal error"
Send inbox
POST
https://pages.fm/api/v1/pages/[:page_id]/conversations/[:conversation_id]/messages
Gửi tin nhắn tới khách hàng
Query Parameters
Headers
Request Body
{
"id": "m_kigIWuq85mIn7ijgUznKbdmaxJ0QidmArUGPAjhej4VUI3t48g39Ixhgpz3QTulmD42DFW386WgoS6DJ3EnbNw",
"success": true
}
"Server internal error"
Reply comment
Gửi trả lời bình luận của khách hàng.
N dung gửi phải chứa tối thiểu một message hoặc một image.
POST
https://pages.fm/api/v1/pages/[:page_id]/conversations/[:conversation_id]/messages
Query Parameters
Headers
Request Body
{
"id": "839761241503256_1144155140262157",
"success": true
}
Last updated