Posts tagged with node.js

I am having trouble obtaining the pages_read_engagement and pages_show_list and ... permissions for my Facebook app. I just created the app and selected the Facebook Login type, but the only permissions available in the use cases are email and user_profile.

I want to create an app that can automatically reply to comments with direct messages, so I need the following permissions:

  • pages_show_list

  • pages_read_engagement
    and ...

Here are the steps I have taken so far:

  1. Created a new Facebook app.

  2. Selected "Facebook Login" as the type.

  3. Tried to configure permissions but only saw options for email and user_profile.

How can I add the necessary permissions for my app? Is there a specific process or additional steps I need to follow to request these permissions?

Any help or guidance would be appreciated.

I am using nodejs to make an api call to add captions to the uploaded video. The response I am getting is success but the captions are not available on the video.

The video is uploaded using {{fb_page_id}}/videos. It returns me a videoId of posted video. Once the video is posted, I am calling {{video_id}}/captions endpoints with caption_file as path to my local file of subtitles. The filename is in the correct format of filename.locale.srt.

Here's the documentation link for captions upload https://developers.facebook.com/docs/graph-api/reference/video/captions/

While using the curl, It is working fine. Here's the curl I am using curl -F 'captions_file=@\"${subtitleFilePath}\"' -F 'method=POST' 'https://graph-video.facebook.com/v19.0/1109093056874668/captions?access_token={{access_token}}&default_locale=none&locales_to_delete=[]'

Looking how to make this request using something like axios, or nodejs-request

I'm trying to get leads and filter them by lead ID or field_data. I'm using the Facebook NodeJS SDK but neither got it working in the GraphQL Explorer.

What's the issue? I want to filter leads by id or field_data but I'm getting An unknown error has occurred.

GraphQL query: 807167831236778 is the leadgen form ID is the Facebook lead ID

807167831236778/leads?fields=id&filtering=[{"field":"id","operator":"EQUAL","value":"346632491054423"}]

NodeJS SDK

const params = {   // trying to filter a specific lead id   'filtering' : [{'field':'id','operator':'EQUAL','value':'123456'}], }; const leadgenFormLeads = await (new LeadgenForm(form.id)).getLeads([                 Lead.Fields.campaign_name,                 Lead.Fields.created_time,                 Lead.Fields.field_data,                 Lead.Fields.form_id             ], params).then((result) => result.map((lead) => lead._data)) 

I am currently writing a chatbot for WhatsApp. I use the node js and WhatsApp Business API to create my API that send messages to users.

When the client sends a image message, I see the following JSON object in the logs of my application:

{ "object": "whatsapp_business_account", "entry": [ { "id": "116591461526821", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "15550383872", "phone_number_id": "107615645766004" }, "contacts": [ { "profile": { "name": "TW🐯" }, "wa_id": "26657963470" } ], "messages": [ { "from": "26657963470", "id": "wamid.HBgLMjY2NTc5NjM0NzAVAgASGCAyQjlFNENGRkFENDk4MkRDQkU4QjVFOTlERUU3RUM4MgA=", "timestamp": "1707306273", "type": "image", "image": { "mime_type": "image/jpeg", "sha256": "iNUQ9GcXEvo/mqx2HYvGYmoX4/sgw3JLLjNe5y3cYHM=", "id": "1549548012254387" } } ] }, "field": "messages" } ] } ] }

can't find any information in the documentation about how to download this file. In my case, I want to upload this image file that the client sends to my file storage. Please tell me which URL method from the WhatsApp API is responsible for this mechanism?