You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.9 KiB

  1. 以GroupID=202061134174478為例子
  2. ***一定要是admin才能發文
  3. 0.『上線』前需要申請權限
  4. 應用程式權限:【groups-api】、【publish_to_groups】、【groups_access_member_info】
  5. Messenger權限:【page_messaging】
  6. 延長權杖:https://developers.facebook.com/tools/debug/accesstoken/
  7. 1.PO文與讀取內容
  8. 1.1在社團發佈一則貼文"I love this Group",再結尾會出現OO(由應用程式發布)
  9. 1.1.0【需要publish_to_groups權限,才能用應用程式發布訊息】,【admin】
  10. 1.1.1.Request:取得
  11. https://developers.facebook.com/tools/explorer/?method=POST&path=202061134174478%2Ffeed&version=v7.0&message=I%20love%20this%20Group
  12. 1.1.2.Response:PO回覆的ID(GroupID-POSTID),
  13. { "id": "620899171850629_622045855069294" }
  14. ==>> { "id": "{GroupID}_{POSTID}" }
  15. ==>> 永久網址 https://www.facebook.com/groups/620899171850629/permalink/621318175142062/
  16. ==>> 可以透過1.2取得留言內容
  17. 1.2取得貼文內容
  18. 1.2.0【需要groups_access_member_info權限,才能顯示ID】,【user】【admin】
  19. 1.2.1 Request:取得
  20. https://developers.facebook.com/tools/explorer/?method=GET&path=202061134174478_205484600498798%3Ffields%3Dcomments&version=v7.0
  21. 1.2.2.Response:from這個是facebook登入顯示的id、name
  22. {
  23. "comments": {
  24. "data": [
  25. {
  26. "created_time": "2020-06-10T08:58:24+0000",
  27. "from": {
  28. "name": "Yh Liu",
  29. "id": "569972750560974"
  30. },
  31. "message": "love +1",
  32. "id": "205485577165367"
  33. }
  34. ],
  35. "paging": {
  36. "cursors": {
  37. "before": "WTI5dGJXVnVkRjlqZAFhKemIzSTZANakExTkRnMU5UYzNNVFkxTXpZAM09qRTFPVEUzTnprMU1EUT0ZD",
  38. "after": "WTI5dGJXVnVkRjlqZAFhKemIzSTZANakExTkRnMU5UYzNNVFkxTXpZAM09qRTFPVEUzTnprMU1EUT0ZD"
  39. }
  40. }
  41. },
  42. "id": "202061134174478_205484600498798"
  43. }
  44. 2.Messenger JS SDK:
  45. https://developers.facebook.com/docs/messenger-platform/discovery/send-to-messenger-plugin?locale=zh_TW
  46. 3.點選send to messenger就可以取得psid