Posts tagged with facebook-graph-api

I'm testing sending media headers through the WhatsApp API. But I keep getting the following error:

{     "error": {         "message": "(#132012) Parameter format does not match format in the created template",         "type": "OAuthException",         "code": 132012,         "error_data": {             "messaging_product": "whatsapp",             "details": "header: Format mismatch, expected VIDEO, received UNKNOWN"         },         "fbtrace_id": "AVPT6EiX3RemyP3uv4S36FZ"     } } 

I'm using a video URL to send the message and confirmed the video is publicly viewable. But I also got the same error when using the video link in the template. I know that there is a Resumable API for uploading the media, but that is not what I'm testing for here.

Any help would be appreciated.

For reference, this is the template:

{             "name": "vid_test",             "previous_category": "UTILITY",             "components": [                 {                     "type": "HEADER",                     "format": "VIDEO",                     "example": {                         "header_handle": [                             "https://scontent.whatsapp.net/v/t61.29466-34/380066992_950204086818012_8956032979900394560_n.mp4?ccb=1-7&_nc_sid=8b1bef&_nc_ohc=pmivIdgTvrAQ7kNvgEgxK28&_nc_oc=Adg2vVNVfN1TlUWzFmJxHpa830uVJRRCSKsooFiDp0E_AQ7gLbB-RIGSlx8UNvM0cXw&_nc_ht=scontent.whatsapp.net&edm=AH51TzQEAAAA&oh=01_Q5AaIFBxPaJzBmN9IaDMHWuIw-w8fQX3uHngw2A_qNyhKBVw&oe=666BB20F"                         ]                     }                 },                 {                     "type": "BODY",                     "text": "tesing {{1}} and use code {{2}} to get amazing discounts on testing videos.",                     "example": {                         "body_text": [                             [                                 "Message content",                                 "MSG25"                             ]                         ]                     }                 },                 {                     "type": "FOOTER",                     "text": "Use the buttons below to manage your marketing subscriptions"                 },                 {                     "type": "BUTTONS",                     "buttons": [                         {                             "type": "QUICK_REPLY",                             "text": "Unsubscribe from Promos"                         },                         {                             "type": "QUICK_REPLY",                             "text": "Unsubscribe from All"                         }                     ]                 }             ],             "language": "en",             "status": "APPROVED",             "category": "MARKETING",             "id": "950180443487043"         } 

And the POST message body:

{   "messaging_product": "whatsapp",   "recipient_type": "individual",   "to": "MY PHONE NUMBER",   "type": "template",   "template": {     "name": "vid_test",     "language": {       "code": "en"     }   },   "components": [     {       "type": "header",       "parameters": [         {           "type": "VIDEO",           "video": {             "Link": "https://static.vecteezy.com/system/resources/previews/006/996/488/mp4/timelapse-full-sunset-free-video.mp4"           }         }       ]     },     {       "Type": "Body",       "parameters": [         {           "type": "text",           "text": "Var 1"         },         {           "type": "text",           "text": "Var 2"         }       ]     }   ] } 

I'm using a rich text editor to create social media posts' text and I save it in DB as HTML to keep the format, I want to send these texts to Facebook Graph API formatted for example:

// DB <p>✨ <strong>Discover Elegance Redefined</strong>! Explore the brilliance of this meticulously crafted <em>platinum engagement ring</em>, featuring a stunning <strong>pavé diamond band</strong> that perfectly complements its breathtaking <strong>center stone</strong>. 💍 #ForeverBrilliant #EngagementRing #LuxuryJewelry #DiamondLove ✨</p> 

//FB ✨ Discover Elegance Redefined! Explore the brilliance of this meticulously crafted platinum engagement ring, featuring a stunning pavé diamond band that perfectly complements its breathtaking center stone. 💍 #ForeverBrilliant #EngagementRing #LuxuryJewelry #DiamondLove ✨

I tried to use HTMLPurifier Library but still not working

I tried sending an opt-in on Instagram from my creator IG account to my personal IG account to Reoccurring Notifications (Marketing Message). I received the error "(#10) This account is not eligible for the Recurring Notification IG Beta". I have the messaging permission, my app passed App Review, I can send normal messages but its just marketing messages that don't work.

On other forums, people say the beta was supposed to end late 2022. Is anyone able to send these opt In messages without being in the beta program? Is the beta program still a thing? Does anyone have any updates on this?

I sent post request to messaging api with "template_type":"notification_messages" and expected to send an opt-in template message but instead received error saying I'm not eligible for IG beta program.

We have been using Facebook login in our app since forever and this has always worked well.

We have upgraded to the SDK v.17 and have changed the code to use limited login into our app. When we open the Facebook login screen, we are always getting this warning:

"If you are not using Limited Login, you will need to handle all Graph API calls using Graph API, iOS. The access token will not be valid. To learn more about changes to the Facebook SDK for iOS and how you can continue using the Facebook Login SDK, visit the blog."

This is strange, because as you can see in the screenshot it does go to limited.facebook.com...

We have implemented it as per the documentation, here is a code snippet with the relevant lines of code:

     let facebookManager = LoginManager()  guard let configuration = LoginConfiguration(permissions: ["email", "public_profile"], tracking: .limited, nonce: UUID().uuidString) else {     return }         facebookManager.logIn(configuration: configuration) { [self] result in     switch result {     case .cancelled:            // throw cancelled     case .failed:            // throw failed     case .success:         if let token = AuthenticationToken.current?.tokenString {            // send token to server         } else {            // throw no token error         }     } } 

Why do we get the warning on the Facebook Login page? Other than the above, is there anything else weI need to change to use limited login? What are we missing here? Also the token we get back doesn't seem to be valid (yet to be confirmed).

FB recently deprecated a number of page metrics, included some we used to generate charts of user interactions divided by day.

https://developers.facebook.com/docs/platforminsights/page/deprecated-metrics

In particular, one metric that was very useful was page_positive_feedback_by_type. It used to return a sum of actions including the counts of comments, likes, shares, over a range of time.

We tried page_post_engagements but it doesn't provide details on which types of engagement are recorded.

So far we're left without a clear way to populate a chart of page comments by a period of time. An alternative would be to get all post types, including ads, for a page, and query comments for all of them, but would result in a huge number of queries which can be both impractical or un-feasible for longer timespans or pages with lots of contents.

What are you using as replacements for these endpoints?