Making Facebook Application in Sandbox mode Accessible to Company Page - facebook

I have a certain scenario that might be obscure but in any event here it is:
1) My overall objective is to stream Facebook updates for my company's Facebook page to Hadoop
2) I know how to do this for my FB page:
a) Requires a FB app
b) A FB Realtime subscription
c) A callback URL to a page that receives the GET/POST
d) A Flume HttpSource to receive the Http Post from FB
All of this has been done successfully for my personal FB page. The challenge is that I would like my company's page to add the App so that I can stream updates from their page to my company's Hadoop environment. My marketing department would like to capture interactions with the page followers for sentiment analysis. Finally I would like to do so with my FB app in sandbox mode.
Is it possible to have a FB app in sandbox mode and still have it visible to my company's FB page so that the page admin can go in and add the app that I created and is still in sandbox mode?
I tried adding the company as a test user and not surprisingly that attempt failed. Is there a proxy user for my company's page that I can setup as a test user?

Related

Why is the Instagram Graph API webhook not working

I am not able to get webhook calls when another user post a comment (with mentions) on another/my media.
Just for testing purposes I set up a ngrok server for my webhook endpoint, which always answers with a 200 and handles the verfication. Before the heavy coding I just wanted to see if the webhook workflow for Instagram is generally working.
I created a Facebook app, an Instagram business account, a Facebook page and linked the page with the Instagram business account. With the information at Webhooks for Instagram I created a page access token with the Graph API Explorer. When I debug the token with the Access Token Debugger, everything looks fine. All needed permissions like manage_pages, pages_show_list, instagram_basic, instagram_manage_comments, instagram_manage_insights, public_profile are there. With the page access token I am able to fetch all informations regarding my linked Instagram business account via the Graph API Explorer.
Also the Instagram product was automatically added to my Facebook app. Test requests, which where send via the app dashboard (Webhooks product), will be received by my ngrok server. But any type of mentions or comments from another or my Instagram account (business or not) on my or other medias will not be received. What am I doing wrong? Do I have to send those comments/mentions from a specific account, since the app is in development mode and there roles in the app?
After speaking with the Facebook support, my confusion has been resolved.
The problem is that the Webhook for the Instagram product does not work without a verified app review. I had been wondering how to record a screencast with my running solution, without running webhooks... Above all, I had wondered why the webhooks in dev mode worked for the product messenger but not for instagram (or others). Apparently, the app review is not about the technical implementation but rather about checking that the implementation complies with the facebook guidelines. Therefor I want to quote the Facebook support:
Messenger does allow page owners and app admins to receive webhooks for their implementations in devmode and is by design. However, this is not the same for instagram or pages. This is just how the product teams have decided to implement it. For app review, you can show a mock process of the flow, using either the test webhook or your own process. The app review is less about technical implementation steps, but just a way to make sure that your app is going to use the permission in a way that follows our guidelines, so mocking the procedure should be fine. The reviewers understand that you do not receive webhooks in dev mode and should take this into consideration.
Consequently, I will now have to submit an app review and for that I have to imitate the webhook.

How to subscribe a facebook test page to an messenger app

I'm new to facebook platform in general.
My goal is an Hello World bot for FB messenger (in test env), iv'e created:
An app + messenger product + webhook that works.
Test user with a test page + i can see in his apps list the app iv'e created.
When i got to the page --> Messenger Platform -> General Settings --> Subscribed Apps - i see nothing on the list.
How can i make my app subscribe? (preferable not programmatically, if possible).
If I'm not wrong you can't subscribe your test page from the messenger settings page, it won't show like you said.
What you can do is subscribe by sending a post request to the graph api.
steps on how to subscribe test page
I followed the steps in there and my test page subscribed and works fine with my app
I struggled with this all day. Hopefully this can help someone out.
Here are the steps I took to get the interaction from a test user -> test page -> chatbot to work:
Create a test user within your developers.facebook App Dashboard (Roles, Test Users)
Login with the test user and create a page (Test Users -> Edit -> Login with this test user)
Get a long-lived page access token that has the scopes:
pages_messaging
pages_show_list
pages_manage_metadata
pages_messaging_subscriptions (this is needed to register the webhook)
Use the page access token to programmatically register a webhook for the test page (don't think you can manually add from the dashboard):
POST to https://graph.facebook.com/v9.0/{testPageId}/subscribed_apps?subscribed_fields=messages,messaging_postbacks&access_token={longlivedPageAccessToken}
Unfortunately, even when I was able to subscribe the webhook + converse with my app through the test page, the app never showed my testpage in the webhooks section, so you'll have to repeatedly message the test page to see if webhooks are being sent.
note: using graphAPI 9.0 for all requests
In your facebook developer console go to setting and see webhook section and then
select a page to subscribe your webhook to the page events

How to subscribe facebook test pages to facebook apps webhook

I am creating chatbot and want to connect on facebook.
I want to test my messenger chatbot in my page, but I must do app review and business verification first and I don't want to do that since I just developed my chatbot (or you can say this is staging environment).
I found that we can create test users, test pages, and test apps. I already create them all, but I cannot find a way to subscribe webhook from my test app to my test pages.
only real page appear in that select a page box.
How to subscribe my webhook to my test page? or is there any other way I can chat to my pages to test my chatbot without using business verification first?
Unfortunately, Facebook test apps / test pages / test users is buggy and seem to not work as expected. (I spent a few hours trying to figure that out)
They seem to focus on real user accounts.
We do not need to do business verification when Status of the app is: In Development
HINT: You can create a real user account in Facebook with any anonymous "false identity" name - so that your identity feels more anonymous and all the pages attached to it - whether published or not. (RISKS: But do not forget your password for this FB account, as you will not be able to recover this "second" FB account, as they might require your passport with that false identity "name" for recovery)
Then - you can create page by admin from real app in Facebook for Developers: Settings -> Advanced -> App Page -> Create Page
And then - just connect your bot to Webhooks in a standard way.
I struggled with this all day. Hopefully this can help someone out.
Here are the steps I took to get the interaction from a test user -> test page -> chatbot to work:
Create a test user within your developers.facebook App Dashboard (Roles, Test Users)
Login with the test user and create a page (Test Users -> Edit -> Login with this test user)
Get a long-lived page access token that has the scopes:
pages_messaging
pages_show_list
pages_manage_metadata
pages_messaging_subscriptions (this is needed to register the webhook)
Use the page access token to programmatically register a webhook for the test page (don't think you can manually add from the dashboard):
POST to https://graph.facebook.com/v9.0/{testPageId}/subscribed_apps?subscribed_fields=messages,messaging_postbacks&access_token={longlivedPageAccessToken}
note: using graphAPI 9.0 for all requests

Facebook webhook for pages not sending info to server

I'm trying to integrate facebook with my application.
I set up a server, webhook subscription went well (subscribed to fields: feed, conversation and messages), callback url is fine, test messages from app dashboard are coming to my server.
Then I have added my fb page to my fb app via graph api explorer and want to test creating posts. I created a post in two ways: via graph api explorer and via fb page. Anyway, no info is coming to my server.
I tested it while app is in development mode and in live mode.
What is wrong with my thinking? Any and all information will be appreciated.
=================================================================
CLOSING
My bad. I didn't noticed that facebook needs to review my app in order to start working

Can't use test user to access Facebook page with Messenger Bot app

I am trying to setup my first Facebook bot by following this sample project in Glitch, connected to this quick start help page.
I have logged in with a real user, then created an app and added a messenger product as per the instructions. I have set the webhook, I have also created a page with this user, and subscribed the messenger bot to it using the app dashboard.
I can access the page with the real user and I can send messages to the page and the bot responds to those messages as expected. So far so good.
Now I would like to create test users, so that I can access this page and send messages with other users. I have followed the procedure indicated here to create such test users.
The problem is that those test users can't access the page: "Sorry, this content isn't available right now"
I have found this and this answers, which both point to this explanation.
Basically, the page the bot subscribes to must be created by one of the test users with manage_pages and pages_messaging permissions. Like this I can create other test users which can connect to the test page and send messages just fine. However, the bot is not properly subscribed to this new test page, despite following the provided steps. I followed all of them and got the success response in the subscription step:
https://graph.facebook.com/v2.9/me/subscribed_apps?method=POST&access_token=<TEST_USER_PAGE_ACCESS_TOKEN>
Still, the bot is not connected to the test page. I can send messages back and forth between test users on the test page, but the bot does not respond and I get no activity logs in the webhook.
In a nutshell:
If I create a page with a real user, I can subscribe the bot successfully to the page, but I can't access the page with test users.
If I create a page with a test user, I can access the page with other test users successfully, but I can't subscribe the bot to the page.
How can I solve this or at least troubleshoot it?
Facebook API v2.9
The test user cannot access your real facebook page but you can message your bot (logged in as a test user) via the messenger short link (m.me/your_bot_link).
I used that in the testing steps (and video screencast) for the app permissions review submission.