Posts tagged with facebook-graph-api

i want to give partner access of business assets to someone via Facebook api, but i have no idea how it can be done.

I tried to use page-id/assigned_users API to assign a page to the user but that also didn't worked, sometimes i got the error, that app-scoped id is invalid and other time i got error: "there is not business linked with this id".

I did some research over chatgpt, and what i got to know is, firstly i need to add the user to business manager and only then i can use above api. But i am not sure if the chatgpt answer is reliable or not.

I have read facebook documentation, but its very confusing !!!

I am new to facebook graph api, so any small help will be really appreciated.

I am trying to create A/B test using facebook graph API. The documentation I follow: https://developers.facebook.com/docs/marketing-api/guides/split-testing

The documentation mentions following curl command:

curl \ -F 'name="new study"' \ -F 'description="test creative"' \  -F 'start_time=1478387569' \ -F 'end_time=1479597169' \ -F 'type=SPLIT_TEST' \ -F 'cells=[{name:"Group A",treatment_percentage:50,adsets:[<AD_SET_ID>]},{name:"Group B",treatment_percentage:50,adsets:[<AD_SET_ID>]}]' \ -F 'access_token=<ACCESS_TOKEN>' \ https://graph.facebook.com/<API_VERSION>/<BUSINESS_ID>/ad_studies 

I am able to run this command successfully and get the split test ID which has been created, but I am unable to find the created split test:https://www.facebook.com/test-and-learn The created test is fetch-able through API GET endpoint, but it does not exist on facebook console. Here is the place where I am trying to find it:

My goal is to create facebook ads A/B test through graph API. Is there any other documentation for this? or am I understanding something wrong there?

I am currently creating an application which uploads information to Facebook using the Facebook Graph API. However, I am currently facing an error when trying to initialize an upload session.

When I write the following C-URL:

curl -X POST "https://graph.facebook.com/v21.0/<THE PAGE ID>/video_reels" \     -H "Content-Type: application/json" \     -d '{{            "upload_phase:"start",            "access_token":"<THE ACCESS TOKEN>"         }}' 

I get the error:

{"error":{"message":"Unsupported post request. Object with ID <PAGE ID> does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https:\\/\\/developers.facebook.com\\/docs\\/graph-api","type":"GraphMethodException","code":100,"error_subcode":33,"fbtrace_id":"ARVFrHVkhXZTsIN4Lzal-Gb"}} 

I have tried to change the permissions on the Facebook account, but when I refresh the page, nothing has changed. Has anybody got an idea what the problem could be?

I'm encountering an issue with the WhatsApp Business API where template messages are not being received, despite getting a successful API response.

Issue: When sending an approved template message via the WhatsApp Business API, I receive a 200 success response, but the message is not delivered to the recipient's WhatsApp. However, normal text messages are received successfully.

Environment:

  • Using WhatsApp Business API

  • Sending messages via Postman

  • Have necessary token and phone number ID

  • Phone number registered and connected in Meta Business Manager

  • Message template approved

Template Message Payload:

{   "messaging_product": "whatsapp",   "to": "917xxxxxxxx",   "type": "template",   "template": {     "name": "billz_order",     "language": {       "code": "en_US"     },     "components": [       {         "type": "body",         "parameters": [           {             "type": "text",             "text": "₹500.00"           },           {             "type": "date_time",             "date_time": {               "fallback_value": "October 25, 2023"             }           }         ]       }     ]   } } 

API Response for Template Message:

{ "messaging_product": "whatsapp", "contacts": [ { "input": "91xxxxxxxxx", "wa_id": "917339249430" } ], "messages": [ { "id": "wamid.HBgMOTE3MzM5MjQ5NDMwFQIAERgSMkRERkFBRTRFRjNEMjA2RkM5AA==", "message_status": "accepted" } ] }

Test Message Payload (which works):

{   "messaging_product": "whatsapp",   "recipient_type": "individual",   "to": "911234567890",   "type": "text",   "text": {     "body": "This is a test message. Hello from WhatsApp API!"   } } 

Despite the message being accepted, it’s not delivered to the recipient. What could be the reasons for this, and how can I troubleshoot or resolve this issue?

  1. Verified that the template is approved in the Meta Business Manager

  2. Confirmed that the phone number is correctly registered and connected

  3. Checked that the token and phone number ID are correct

  4. Ensured that the template payload matches the approved template structure