Posts under category Meta & Facebook

Unable to receive webhook of activity on the Page, resulting in incomplete system functions and inability to apply for other related scopes. The scope "pages_manage_metadata" has been approved, but we still cannot receive webhook generated by any "non-APP tester" Page activity(only the specified tester role of this application can receive it)

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?

I'm currently working on a workflow to fetch all posts made by my company on social medias. On Facebook, I'm currently using the ads_posts endpoint to fetch both organic and paid posts (was previously using /feed for organic posts and /ads on the business account for paid posts, however the ads endpoint was lacking some posts that were created through dynamic ads).

The current request is like this:

https://graph.facebook.com/v21.0/{FB_PAGE_ID}/ads_posts?fields=id,created_time,updated_time&include_inline_create=true&access_token={PAGE_ACCESS_TOKEN}.  

The problem is, this endpoint only gets me data from within about a month ago. Any try to fetch data older than that using the filters "since" and "until" returns no data, and trying to go there manually through pagination gets me an error of:

Please reduce the amount of data you're asking for, then retry your request

(the "limit" filter doesn't help with this either).

Am I missing something here? Is this a limitation of the ads_posts endpoint? I couldn't find anything related to this on the API reference.

Also, i saw that the posts returned via /ads_posts are sorted by their creation time, while the ads fetched on the /ads are sorted by their update time. Is there any way to change the sorting of the ads_posts entries to their update time as well?

Thanks in advance!

Using https://graph.facebook.com/v21.0/{AD_ACCOUNT_ID}/ads?fields=id,created_time,updated_time,creative{effective_object_story_id}&access_token={USER_ACCESS_TOKEN} i'm able to get ads from 2024-12-01 and before, with their effective_object_story_id that I can access through the post endpoint and check that they in fact exist.

Using the mentioned /ads_posts request, it gets me only posts as old as from 2024-12-06 (3101 posts total). Anything older than this gets me an error or no data at all.

All the posts have been published the same way, and the tokens used have all the needed permission.