-
Notifications
You must be signed in to change notification settings - Fork 515
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/use get method for get #110
Feature/use get method for get #110
Conversation
Currently all facebook API calls are made using the HTTP POST method. A parameter called "method" is passed in the request body indicating the actual verb that the API call requires. Under certain circumstances, facebook returns an error indicating that the application does not have the capability to make this API call. This error does not occur when using the GET method to execute these API calls.
Also, only specify the method param if we are going to use the POST method to make the API call
I don't quite understand what's the problem. Can you please give me a sample case in which a graph API must be called with HTTP GET request? |
Hi! We got exactly the same problem. For some reason sometimes requesting info about ad account using POST method instead of GET method results in |
Sorry, this fell off my radar until I saw this last comment in my email.
for my user account, this works fine. However, for another user in our company, it generates the error I specified in the original report. Like I said earlier, its hard to figure out why this happens - the only thing we could find is that when we use the GET method, the problem never occurs. We have now been running this code in production since the day I submitted this PR and never had a single problem. Whereas, prior to this, we had multiple users report this. Note that if this problem does occur for a user, it consistently occurs - so there's something about user access tokens that triggers this, but its hard to determine what that is. Ravi |
Just a thought on why you are seeing different behavior depending on the user: Possibly because some are Facebook developers (or for that matter, verified developers) and some aren't? |
Interesting theory - I just tested this, but that's not it.
He and I both have verified facebook developer accounts and the problem does not occur for my account. |
Different access levels on the ad account? I'd search the bugs and open one if you can't find anything instead of modifying the library as POSTing every call is accepted behavior and this feels more like a bug then some intended edge case. |
@nayakravi Your case looks quite interesting. If this design introduces some bad cases, I can update code to send all I don't think it's OK to add an option like |
@nayakravi Oh, three other questions:
I ask all of this because I can try to get a repro case together and provide you for a FB bug submission, which I still think this belongs as. I agree with @huandu though, follow the PHP SDK standards when at all possible, do not add this extra option to control |
Thank you @huandu - that is the best solution - my approach was to ensure I encountered least resistance to this change.
|
@robbiet480 - here's answers to your questions: Are you using the same application for both your user account and co-workers? Just noticed the error is about the application specifically. - both use the same application |
We have encountered issues with certain Graph API calls where in we encounter an error of the form (#3) Application does not have the capability to make this API call". There have been multiple tickets logged with facebook for this, but there's been no resolution. In our case, we were able to resolve this by used the GET http method to make GET API calls rather than the POST method used by default in this library. Its impossible to figure out if this is systemic or triggered under specific circumstances.
This PR provides an option to use the GET HTTP method to make GET API calls to at least provide an option to work around these errors.