I got the error "Application request limit reached" 2 days back. So I have removed all the extra API calls from my website and added just two calls.
Get user details after successfully login using Facebook credential and get access token.
Using User access token fetch all the pages of user.
After removing extra API calls I have checked my websites after 48hours but when I tried to login using Facebook credential and trying to fetch user's pages, It throws "Application request limit reached" Error.
Can anyone please help me to solve this issue?
Thanks.
Related
This question already has answers here:
Facebook Messenger App Invalid Scope - permission: pages_messaging_subscriptions
(3 answers)
Closed 6 years ago.
I had a submitted and approved Facebook messenger bot working. But I just got a developer update just now saying
"Your Webhooks subscription for callback URL https://BOTNAME.herokuapp.com/ has not been accepting updates for at least 16 minutes. Please verify that your callback server is functioning."
I do see that my callback server and application is working on Heroku.
This problem usually gets solved if I generate a new page access token and restart the web application with this new page access token in it. But this time I'm unable to generate an access token either.
I tried generating a new page access token from my Developer account page for the specific page on which the app is running, but the error now says
"Invalid Scopes: pages_messaging_subscriptions. This message is only shown to developers. Users of your app will ignore these permissions if present."
There is no Documentation on this. Any suggestions?
I got this message today also. This is the bug from Facebook.
Right now, you can get Page Access Token via Graph API Explorer instead of App Dashboard.
Go to: https://developers.facebook.com/tools/explorer/
Click Get Token > Get User Access Token
Select the following scopes : manage_pages, pages_messaging, and pages_messaging_phone_number.
In Application selector, select your app.
Select your page to get Page Access Token.
Now you have Page Access Token, which you can use it for your Messenger Bot.
Check whether it worked by doing :
curl -X POST "https://graph.facebook.com/v2.6/me/subscribed_apps?access_token={{your_access_token}}"
I was also having the same difficulties. Its now resolved and they have now changed the way page access token is issued.
I am trying to link my application to a facebook user account but every time I go through the process of retrieving their profile I get this error:
string(140) "{
"error":{
"message":"An active access token must be used to query information about the current user.",
"type":"OAuthException",
"code":2500
}
}"
The reason I am confused is that when I initially request an access_token from facebook it return a token for me.
string(56) "access_token={app_id}|{app_secret}"
Which I am then told is expired and I don't know why.....
I understand in order to get an access token you must follow a particular workflow.
Client Requests access and permissions via SDK and Login Dialog.
User Authenticates and approves permissions
Access token returned to client
Graph API calls with short-term access token (web) or long-term access token (native mobile)
Based on what I've seen in my code, I get to step 3 but step 4 fails because the token is said to be expired. Does anyone have any idea what I can do to fix this!?
I notice that for step 1 the login dialog is never shown but I still get an access code returned despite this. Could that be something to do with it? This is the way I perform step 1.
<a class="lists" href="https://graph.facebook.com/oauth/authorize?client_id=564083793722908&redirect_uri=<?=urlencode($facebook_callback_url)?>&scope=offline_access,publish_stream,status_update">Connect a Facebook account</a>
Step 2. never seems to occur
Step 3. An access token is returned though. See above.
Step 4. Fails with the above error of expiration.
Any advice?
You cannot request user information with an app access token. You need a usser access token to do that. Your Login process needs to adhere the docs at
https://developers.facebook.com/docs/facebook-login/manually-build-a-login-flow/v2.1#login
to get a user access token. Apparantly, this is not the case with your code.
Furthermore, you're only using permissions which are (long) deprecated. See
https://developers.facebook.com/docs/facebook-login/permissions/v2.1#adding
https://developers.facebook.com/docs/facebook-login/permissions/v2.1#reference
I am trying to publish Facebook Timeline actions using the app access token instead of the user's access token (so that I don't have to deal with expiring sessions), as described here:
https://developers.facebook.com/docs/opengraph/using-app-tokens/
This was working fine, but stopped working a few days ago, now giving me this error:
The client token cannot be used for this API
Any ideas on why this is happening, and how to fix it?
I am trying to read the inbox and outbox of a Facebook Page. My first approach was to try to directly access the inbox of a page node. The URI below indicates how I tried to get it:
/{page-id}/inbox
Here is the error message:
You can only access the \"inbox\" connection for the current user.
Then I tried to access the conversations and threads edges as suggested in some places like so:
/{page-id}/conversations
/{page-id}/threads
Both URIs produce the following error:
(#298) You must be a developer of the application
I couldn't figure out what is wrong at all? There are some bug reports to Facebook, related to "#(298)", which were reported a few months ago but I can't believe it hasn't been fixed so far.
Any alternative approach is welcome.
This problem happens if you use a user access token instead of a page access token.
I was doing this in the Facebook Graph API Explorer and I thought I was using the page access token but I wasn't. When I ran {page-id}/conversations?access_token={page_access_token} from the API Explorer, it had the {user_access_token} in the Access Token field at the top. This was being sent in the actual request that the Explorer sent (as seen in Chrome's dev tools). I.e., the API Explorer was ignoring the {page_access_token} I entered and was using the value in the Access Token field.
Clearing the Access Token field or entering the {page_access_token} in that field resulted in the intended {page_access_token} being sent. Doing some of the steps in the browser vs the API Explorer showed me the way.
These are the steps to resolve the issue:
Get a user access token: with manage_pages and read_page_mailboxes permissions* by clicking Get Access Token from the API Explorer and selecting the specified permissions or visiting the URL below.
https://www.facebook.com/dialog/oauth?client_id={app-id}&redirect_uri={redirect-uri}&request_type=token&scope=manage_pages,read_page_mailboxes
Get a page access token: by running /me/accounts from the API Explorer or by vising the URL below.
https://graph.facebook.com/v2.0/me/accounts?method=GET&format=json&suppress_http_code=1&access_token={user-access-token}
Get conversations: Use the page access token (paste it in the Access Token field if using the API Explorer) from the above step to get conversations** by running /{page-id}/conversations or by vising the URL below.
https://graph.facebook.com/v2.0/{page-id}/conversations?method=GET&format=json&suppress_http_code=1&access_token={page-access-token}
* read_mailbox permission is not required, contrary to what I said in my comment above. Actually, the error message was incorrect, attempting to access Page edges with a user access token incorrectly gives user access errors instead of invalid Page access token errors.
** The user must be an admin of the Facebook Page to access its conversations.
We have a Canvas Facebook App and for some time we get a strange error for some of the users that are trying to install (allow) our Facebook app. I mention this is happening only for some of the users and not for all! The error we are getting is "The remote server returned an error: (400) Bad Request." The graph API call we putted in a try catch block and this is what the logs says when I searched over them to see what went wrong. The graph API call is:
https://graph.facebook.com/oauth/access_token?client_id=XXX&redirect_uri=XXX&client_secret=XXX&code=code_received_from_facebook.
We received the code from Facebook and append it to the graph API call from above but it seems that for some users this is not working. Our redirect_uri parameters contains an URL to our Facebook App and contains also some parameters (example: http://apps.facebook.com/our_application_URL?cid=xxx&surveyid=xxx&messageid=xxx).
xxx = some values.
Did some of you confront with this kind of strange behavior? Working for some users but for other is not working? We are using the same code so nothing change between a successful installation and a unsuccessful installation.
Thank you for your help in advance!
Now that Facebook require SSL for applications your "redirect_uri" need to be https (i.e https://apps.facebook.com/myapp/), otherwhise you will get "Bad Request".
You probably got the error for only the users that had forced SSL but not the rest.