Posts tagged with facebook-graph-api

I'm developing an Laravel API to manage Facebook Graph API and I need to post events on a page. I can list all the events but to create an event, I receive the following message:

"Unsupported post request. Object with ID '00000000000' does not exist, cannot be loaded due to missing permissions, or does not support this operation." "code": 100, "error_subcode": 33.

Searching, I saw that I need the pages_manage_events but I can't see the permission in the permissions list. How do I need to proceed to have this permissions in my facebook app? Remembering that my app is in delevoping mode and is Business type

I'm experiencing an issue with Instagram Direct referral data being passed through the webhook. In some cases, when a user clicks a "Click to Instagram Direct" ad, the webhook includes referral information (e.g., "source": "ADS", "ad_id", etc.). However, for other users who click the very same ad, the webhook payload contains no referral object at all-only the basic message fields. In Meta Business Suite (Ads Manager), I can see that both groups of users did indeed come from the ad. Yet only some of them generate referral data in the webhook. Here are two JSON examples showing the difference: With referral data (includes "referral": { "source": "ADS", "ad_id": Without referral data (no referral field, despite the user coming from the same Instagram ad). have already verified that: My webhook is subscribed to messaging_referrals. The ads are set up using the "Click to IG Direct" objective/format. Everything else in my setup seems consistent. I would be glad to hear any advice on what the problem may be, or if there are any nuances in using Facebook

UPD: I have managed to reproduce this problem, namely if I go to an advertisement in the news feed, click ‘send message’, a modal window appears, after which I do not respond to the message, but close it and go to my account, after which I respond to the welcome message from the advertisement. In this case, we receive a text message via webhook. My pages are subscribed to messages,feed,messaging_postbacks,messaging_referrals

I want to print dynamic multiline text in whatsapp messages. The messages are sent via Facebook Graph API. I have used the \\n character to insert a new line. See request below.

Request:

POST https://graph.facebook.com/v20.0/XXXXXXXXXXXXXXXX/messages Content Type: application/json; charset=UTF-8 Body: {"messaging_product":"whatsapp","to":"XXXXXXXXXXX","type":"template","template":{"language":{"code":"en"},"name":"order_updated_message","components":[{"type":"body","parameters":[{"type":"text","text":"Jon Doe"},{"type":"text","text":2},{"type":"text","text":" *1. Wrapped Plate, 8 in | 1 Pc*\\nRate: 3.000\\nQty: 8000\\nAmount: 24000.00\\n\\n *2. Bottle Brush | 1 Pc*\\nRate: 18.644\\nQty: 11\\nAmount: 242.00"},{"type":"text","text":24242.00},{"type":"text","text":"John Lee"},{"type":"text","text":"+91XXXXXXXXX"}]}]}} 

The request succeeded till a few days ago, but then kept failing. See the failure response below.

Response:

HTTP Status: 400 Bad Request {     "error": {         "message": "(#100) Invalid parameter",         "type": "OAuthException",         "code": 100,         "error_data": {             "messaging_product": "whatsapp",             "details": "Param text cannot have new-line/tab characters or more than 4 consecutive spaces"         },         "fbtrace_id": "XXXXXXXXXXXXXXXXXXXX"     } } 

If I remove the \\n character, the request succeeds. So Im assuming the failure is caused by \\n itself.

I also tried replacing \\n with the following:

  • \n --> same error
  • \u000A --> same error
  • %0A --> character displayed as it is. (No new-line)

Can you tell me what has gone wrong?

Note: The message body contains our customer's ordered items. The number of items can vary by order and hence the number of lines can vary in each message. Thus, I cannot add new lines in the message template.

I am trying to create an application that publishes posts to my Facebook Page. Here are the steps I have taken:

  1. Create app via link https://developers.facebook.com/
  2. In section Add use cases I selacted Other
  3. Select an app type -> Buiseness
  4. Then I created app
  5. I didnt add any Add products to your app I directly go to https://developers.facebook.com/tools/explorer/
  6. In permision section I selected pages_read_engagement and pages_manage_posts
  7. Then in User or Pages I selected Get Page Access Token
  8. I selected my page (I created it)
  9. Then I generated access token
  10. I run this query and copy number id from return
  11. Then I run /id/feed POST to publish post:

I get error message that I'm not admin or have incorrect permissions. In my opinion this is correct so issue is somewhere other. Can you please help me find solution for running POST query and publish post on a FB page?