How to auto delete Facebook account if I pass away? - facebook

Has Facebook this feature in its API?
I did a Request account deletion but someone should tell Facebook that the fact was fulfilled through this form.
How can I auto fill out this form and submit it or send a delete account request to the Facebook API after my activity has not been confirmed in an external service?

Related

Webhooks for Lead Ads working but api call to get form values don't

So, I've created a Webhook with Facebook for my Ads Leads. It is working - I'm receiving the Webhook with the RTUs.
The problem is when I call the api to retrieve the data associated with the form. I'm using the leadgen_id to call the api and I'm gettin:
Unsupported get request. Object with 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
The point is: when I test it here: https://developers.facebook.com/tools/lead-ads-testing the leadgen_id that is returned works with my API calls and I can access the form data that I need.
But when I try with the leadgen_id that I receive from users registering in my ads, it returns the error message.
Any idea of how I can solve this problem?
This sounds like missing 'scopes' on the access token you are using to make the Graph API call. Generally, for webhooks you need a few scopes, these are the ones I currently have on my webhook:
pages_manage_cta, pages_show_list, ads_management, leads_retrieval, pages_read_engagement, pages_manage_metadata, pages_read_user_content, pages_manage_ads, pages_manage_engagement, public_profile
You can use the Access Token Debugger tool to see the list of scopes on your access token (https://developers.facebook.com/tools/debug/accesstoken/)
Your Graph API access token might have expired. To setup a permanent access token follow the instructions on here: Long-lasting FB access-token for server to pull FB page info
I had this same problem. I was able to get this to work by giving my System User 'Manage Page' access and 'Leads Access' in Business Manager.
Add your System User to the Page with 'Manage Page' access.
Business Manager > Business Settings > Accounts > Pages, and select the Page you are working with from the list.
Click 'Add People,' select your System User, and toggle 'Manage Page' setting.
Add your System User to Leads Access.
Business Manager > Business Settings > Integrations > Leads Access, and select the Page you are working with from the list.
Click 'Add People, and select your System User.

Connecting third party Facebook page via messenger api

I have an application that uses the Facebook messenger api to send and receive messages through a Facebook page. This works great. Now I need to be able to have a user in my application link their page so that messages sent to their page will send webhooks to our endpoint, and also give us the ability to send messages through that page using an auth_token.
Is there any way to do this via api, or will each user have to manually create a Facebook app, generate an auth_token for their page, and set the webhooks url to our endpoint? I've read about messenger account linking but I don't think it's quite what I need, as I'm not just looking to request additional profile information.
After looking a bit deeper, I found that in order to do this you must perform an OAuth flow to get an auth_token for the user, then use the graph api to get an auth_token for the desired user's page. Then with the page auth_token you can make a POST request to the subscribed_apps endpoint, which will then add the page to the app's webhook events.

APP/API creation for page in Facebook Business manager?

I am new to business manager as all of the pages I manage I have created myself. I have said I will look after a page for someone and they have granted me access, thus the page appears in my Business manager and I can make changes.
What I need to do is create an App/API connection to link the page to the website, is there anyway to do that without logging in through the customer's personal account or asking the customer to create the app?
The App needs to allow the website to autopost status updates.
Regards
Donna
For posting status updates with the API, you need to do the following:
Authorize someone who can post "as Page" with the manage_pages and publish_pages permission
Get the Page ID with the following API call: /page-id?fields=access_token
Post by using the resulting Page Token with this endpoint: /page-id/feed
...of course you need an App for that.
More information about Tokens:
https://developers.facebook.com/docs/facebook-login/access-tokens
http://www.devils-heaven.com/facebook-access-tokens/

Facebook Messenger API pages_messaging permission

I am creating an application where I need a user to be able to grant us access to their facebook page so that all incoming messages can flow through our application (as well as outgoing).
I have this all working correctly, but facebook will not approve my app due to the facebook permission pages_messaging and them "not receiving a response from my bot" (I have been denied three straight times). What am I doing wrong here? We are not using bots, do I even need the pages_messaging permission (I am using their webhook to get incoming page messages, and graph api to send outgoing)?
When submitting app, pages_messaging permission says:
Please provide the page that can be used to test this bot. Make sure the bot is properly connected and functional, otherwise your submission may be rejected.
Here is facebook's feedback from my submission (denied multiple times):
Thank you for your submission. We tested the messenger experience on your associated page and received no response from your messenger bot. Please resubmit with the new, improved version of your bot.
You got to create a bot to use the messaging API: https://developers.facebook.com/docs/messenger-platform/implementation
To just read/send messages:
https://developers.facebook.com/docs/graph-api/reference/v2.6/conversation/messages
You can use the /pageID/conversations endpoint to retrieve all conversations your page has had with FB profiles.
Next you can read/post to the /conversationID/messages endpoint to read/respond to a person.
And you can even subscribe to the conversations field for pages with webhooks.
You will need a page admin's page access token that has the read_page_mailboxes permission scope to set up the subscription, and to read/reply to messages.

Facebook connect and account remove

I have a website where users can log in with the Facebook oAuth API.
Once the user logs in or registers via Facebook it is stored in my database.
But what I'd like to achieve is, once the user goes to his Facebook application settings page and removes my website app permissions, the used should also be deleted from my database.
Is there any work around to this problem, if this is not possible via the Facebook oAuth API?
You can add Deauthorise Callback URL by Navigating to Settings > Advanced section of your application. Whenever a User Deauthorises your Facebook app, Facebook performs a HTTP POST of signed request to your URL. You may use the field user_id to determine which User has deauthorised your app.
Actually, I would do the following:
Add a date to his last log in to your site.
Have cron job check for old, unused accounts.
Send an email to the user's email address (or Facebook message mail) telling him his account is due to expire soon.
Delete account from database.