Posts tagged with facebook-javascript-sdk

Facebook page reels video upload with API facing issue

{ "error": { "message": "(#200) subject does not have permission to post videos on this target", "type": "oauthexception", "code": 200, "fbtrace_id": "afayglg374lfu4ml65zprso" } }

Note: upload my own page

Remove Facebook app and reconnect again and allow all permission requirement documentation,

One time everything is perfect but suddenly show this error then I try create new app and try again but still show this problem and also change the my machine(PC) use new Facebook account and new page but You still show this problem

In my application I want users to edit their leadgen forms. As far as I know there is no possibility to edit a leadgen form. Simply creating a new leadgen form with the desired changes would result in losing linked data, such as leads.

Therefore, via the UI (Adsmanager) one would copy the leadgen form and make the desired changes which keeps the linked data (leads).

I was wondering if there is a [leadgen_form_id]/copy endpoint? Or how can I edit a leadgen form without losing linked data.

I'm developing an app that will make use of the Business On Behalf Of API (https://developers.facebook.com/docs/marketing-api/business-manager/guides/on-behalf-of#bm-client). Based on the steps in the documentation above, I was able to progress with regards to login (step 0), creation of the partnership between the BMs (step 1), generation of the access token for the client's BM system user (step 2) and I am stuck in obtaining the system user identification number (step 3) through the following request:

curl -i -X GET
"https://graph.facebook.com/v19.0/me?access_token=<CLIENT_BM_SU_ACCESS_TOKEN>"

I have a valid system user token, with all desired permissions and attributes, validated through the Access Token Debugger (https://developers.facebook.com/tools/debug/accesstoken/?access_token=...&version=v19. 0). However, the request to get this user's id continues to return an empty json as a response.

Request made: curl --location 'https://graph.facebook.com/v19.0/me?fields=id&access_token=...'.

The response is always {} (empty json).

access token debugger output

My app's permissions at login are: pages_read_engagement business_management ads_management

The system user access token created in the customer's BM has the following permissions: ads_management pages_read_engagement

as the documentation suggests (I've already tested generating this token with other permissions, but the problem persists).

I tried to research whether it was a lack of permissions, but I couldn't find anything conclusive. I researched the app's settings and didn't get promising results either. I tested using both Login and Login for Business as a Product for my app, but there was no difference in relation to the problem. Making this same request with user or system user tokens, administrators or not, from my accounts and my BM works as expected (returns the user id), but when it is a system user of the client's BM, following the step the step of the Business Intermediation documentation, it doesn't work.

I need this id to assign the assets to this user and then have access to the client's pages. By manually obtaining the user ID through the debugger and following the other steps, it is possible to complete the entire process and carry out the intermediation as expected (manage the assets on behalf of another company). However, this step is not allowing me to automate the process 100% and will hinder the usability of my application. Am I missing something?

i have 1 dog page on Facebook, i usually post photo of dogs when ever i have time, so trying to write a scheduler that will take images from my system folder and upload and publish on my page.

i want to post images, from my local system to 1 of my managed pages. i have page access token. and using below curl i am getting response as well.

curl 'https://graph.facebook.com/v19.0/page_id/photos?published=true' -H 'Cookie: ps_l=0; ps_n=0; ps_l=0; ps_n=0' -F 'access_token="my_page_access_toekn"' -F 'source=@"/C:/Users/Downloads/cute_dog.jpg"' -F 'publish="true" 

and i am getting response back

{     "id": "38868xxxxx",     "post_id": "10326941xxxxx_388682220xxxxx" } 

when i login from my own account, i can see the images being posted on the page. but when i login from my friend account, i don't see the image. i tried adding publish="true in body as well as in path param, but nothing seems working. for reference, i am following this page https://developers.facebook.com/docs/pages-api/posts

what am i missing?

I need to get authenticated for Instagram API. I have a business profile. And I'm trying to authenticate via FB login via the JS SDK:

  <p id="profile"></p>   <script>     function checkLoginState() {       FB.getLoginStatus(function(response) {         statusChangeCallback(response);       });     }     window.fbAsyncInit = () => {       FB.init({         appId: 'xxxxxxxxxxxxxx',         cookie: true,          xfbml: true,         version: 'v19.0'       });       FB.login((response) => {         if (response.authResponse) {              console.log('Welcome!  Fetching your information.... ');              FB.api('/me', {fields: 'name, email'}, (response) => {               const msg = `Howdy ${response.name}. Your email address: ${response.email}`;               document.getElementById("profile").innerHTML = msg;              });         } else {            console.log('User cancelled login or did not fully authorize.'); }       });       FB.getLoginStatus((response) => {         if (response.status === 'connected') {           console.log(response.authResponse);           alert(`response.authResponse: ${response.authResponse}`);         }       });     }; </script> <!-- The JS SDK Login Button --> <fb:login-button scope="public_profile,email" onlogin="checkLoginState();"> </fb:login-button> <div id="status"> </div> <script async defer crossorigin="anonymous" src="https://connect.facebook.net/en_US/sdk.js"></script> 

I click the button, get redirected at FB, enter login/pass in the dialog window, enter 2FA code. And then it'll ALWAYS get stuck on this dialog, on the half-way:

with this url (modified):

What's going on here?