'Cannot call API on behalf of this user' on FB API call - ruby-on-rails-3

I am having trouble with facebook API call. I am using Koala for server side api call but recently came into issue making api call. So I tried to bypass koala call and did raw api http call using call but to no avail.
When I do curl from development machine it works fine.
curl "https://graph.facebook.com/me?oauth_token=my_token
It returns profile details, but the same thing done from production machine, it's throwing the exception
{"error":{"message":"Cannot call API on behalf of this user","type":"OAuthException","code":200}}
Does anyone had the same issue? Like to hear from you guys.

I found the source of the problem (on our site, at least). In Facebook's developer console (https://developers.facebook.com/apps), our app was showing an invalid privacy policy. Due to this, Facebook had automatically placed our app into Sandbox Mode.
Updating our privacy policy and (more notably) removing our app from Sandbox Mode caused this error to cease.
Other users seem to have had some success with removing regional (country-specific) restrictions on who can and cannot log in to their app (https://groups.google.com/forum/#!topic/django-social-auth/XaE5dFXEqhA)
Best of luck! :)

I had the App in dev mode. All I did was remove the subscription & resubscribe my webhook server and this worked for me.

Related

Botframework v4 - Facebook Channel - Operation returned an invalid status code 'Forbidden`

Last year I developed a chatbot with Microsoft Bot Framework that I integrated in the Facebook Messenger of a page. Everything worked fine until 16th of December (last successful log). The page is not used by a lot of people therefore the application might have worked also longer than that.
Today I tried to use the chatbot again and I did not get any response. In the Logs I just found the error message "Operation returned an invalid status code 'Forbidden`".
After a bit of Debugging I found out that the problem is sending messages back to the Facebook Messenger.
context.SendActivityAsync(...)
I did not change any configuration within my Azure Bot Channel registration recently. I am aware of the privacy changes within the Facebook API, but as I already struggle with sending a simple text response like "Hi" I assume that cannot be the problem. Also the permission scheme has changed for Facebook apps. I have the permission for "pages_messaging". Do I need another permission now? Or did I miss another change in the Facebook API?
Technical Details:
Facebook API Version v6 (tried also v9 but no change in behavior)
Chatbot based on .Net Core 2.1
Bot Builder SDK v 4.11
Any hints what I did wrong or where I can look for further information is much appreciated.
Edit: I tried to add a new page to my Facebook App and get following message:
There is a hint that a permission is missing, but I cannot find out which one I require. As I only send responses to FAQ's and if required handover to the customer service inbox I just requested the "pages_messaging" permission. Do I require any other permission now?
I found the problem. For everyone that might have the same problem:
In our case the administrator that added the Facebook pages to the application was removed from the admin permission list of the pages. After re-adding the admin permissions for the pages the bot started working again.

linkedin oauth2 login returns "504 Gateway Time-out"

I'm using linkedin login on my website. Everything was working until last week, when it started returning "504 Gateway Time-out" error. I did not change anything in my application settings on linkedin developer site nor in my application code. Weird thing is that it still works fine on localhost, but on production it returns error described above. My question is:
Is it more likely to be a problem on Linkedin side? Because for me it seems that my website is trying to connect to linkedin API but it never gets a response.
Unfortunately I have not found any address that I could contact regarding this problem. Is there any linkedin support for this ? Or have any of you were experiencing similar problem?
Thank you
I had the same issue the solution was to set the header Content-Type to application/json.
The LinkedIn Developer API appears to be down. Requests to:
api.linkedin.com/v1/people/
are failing consistently.
And while this might be a separate issue, it's worth noting that the documentation for integrating with their OAuth2 service is no longer accessible at https://developer.linkedin.com/docs/oauth2.

Quickblox sdk - Authentication token is required error (xamarin.forms)

I am trying to run quickblox sample chat application which I got from following link
https://github.com/QuickBlox/quickblox-dotnet-sdk
Issue here is, when I run the app, it fails to load base session and gives error such as "{"errors":["Token is required"]}". I tried to debug it but could not find the root cause of it.
(Example code is using Quickblox sdk 1.2.2, which I tried to upgrade to 1.2.7 as well but in that case also still that issue remains)
The method inside sdk uses service call to api (http://api.quickblox.com/session.json) for getting session, which I tried to call by using Postman (google chrome extension), in which case I was able to get the session in response. Strange it is.
Does anybody know what is wrong with the example?
Update: I tried to manually write http call for getting session. Now in this case, I am no more able to access dialogs and other api calls are also failing(getting forbidden error in almost all sdk api calls after authenticating).
Could anybody tell me what is going wrong here?
After spending complete day found the fix. It was really small issue. Currently sample in github is using http://api.quickblox.comas a api end point, change it to https://api.quickblox.comand it will start working. Note the 's' in url.
The best way to do this is by using the account settings API.

PayPal - switching from Sandbox to Live account using REST API

We tested our web application successfully using a sandbox REST API account (and test credentials).
When we wanted to put the application into production (using REST API live credentials visible on the same PayPal web site where the sandbox/text credentials were shown), we received an error from the production PayPal server on a live credit-card transaciton:
Error code : 401 with response : Server returned HTTP response code: 401 for URL: https://api.paypal.com/v1/payments/payment
We have a Business Account that is not yet 100% verified (75% verified at the moment), so we are not sure if this is caused by some technical issue or the fact that the account is not yet 100% verified.
PayPal web site is quite confusing and the process of moving the app from test to production is not clearly explained. It seems that they are migrating from some old web sites to new ones and the user is prompted to login multiple times, redirected to different URL-s... E.g. we can see our application test and live credentials on the developer.paypal.com, but not on apps.paypal.com where no apps are listed, even though the same user is logged in (owner of the business account)???
For future readers, you have to use Live Credentials, on https://developer.paypal.com go to My apps and in App details there is a link at a bottom of the page :
Click on that link and you will see live credentials.
You now click on your sandbox application and then click live at the top of the screen to get your live credentials.
For the PayPal REST api use the credentials provided on developer.paypal.com (new version of PayPal dev experience). Live calls require the account to be vetted which includes fully verified.

API Exception (OAuthException: Cannot call API on behalf of this user)

Got the following exception when calling api (/me) using the latest PHP SDK.
OAuthException: Cannot call API on behalf of this user.
The same exception appears for some facebook account only. Any clue?
I found the source of the problem (on our site, at least). In Facebook's developer console (https://developers.facebook.com/apps), our app was showing an invalid privacy policy. Due to this, Facebook had automatically placed our app into Sandbox Mode.
Updating our privacy policy and (more notably) removing our app from Sandbox Mode caused this error to cease.
Other users seem to have had some success with removing regional (country-specific) restrictions on who can and cannot log in to their app (https://groups.google.com/forum/#!topic/django-social-auth/XaE5dFXEqhA)
Additionally, #Igy's questions sound reasonable and might lead to finding a solution as well.
Best of luck! :)
Is that user's access token still valid? Has the user blocked you? Can you navigate to the user's profile manually? (i.e their profile might be unavailable)