Rest API (wordpress) being blocked on cloudflare? - rest

For a week now, we had issues connecting Zapier to our WordPress account as it always show the 503 error. Also, on site health, we have loopback and rest api errors. We decided to pause cloudflare for the site and it is working fine now.
My question is, is there a way to prevent cloudflare from blocking rest api?

thank you for the insight that you gave it helped me understand a bit more about the 503 error. I stumbled upon an article and the issue was similar to mine. It seems that the issue came from enabling Bot Fight Mode. Here is the article just in case some of you might encounter the same issue: https://journeybytes.com/wordpress-cron-error-503-by-cloudflare

Related

Delphi REST Debugger Returns Error 429 Too Many Requests but Browser Returns JSON as Expected

What is the difference between the way a browser calls the URL and doing it via Rest Debugger or HTTP Components?
I have a 3rd party Web REST API that work every time in a browser (IE it returns JSON as expected), but when I use (GET) the same URL in the Delphi REST Debugger it returns error code 429 Too Many Requests.
I am not allowed to post the exact URL here (I'm sorry, boss has the last say but it is like this https://xxxx.yyyy.com.au/search/resources/store/zzzzz/productview/123456).
For additional information the result is consistent giving the 429 error when I use NetHTTPClient and NetHTTPRequest components as well as using the Delphi REST Components.
I thought that setting the user agent to be the same as my browsers might help, but alas it didn't. I use Delphi 10.3.3 Rio
I'm a bit new to REST and haven't found an answer by googling for a couple of days now. Any help will be most appreciated.
Thanks,
John
The answer is cookies. When I rejected all cookies I could see the behavior as stated by #RemyLebeau where the page is in a continuous loop. The browser sends a cookie with the request header. I'm new to all of this, so I'll try to replicate what the browser is doing and see what happens. If I get really stuck I'll post another question specifically about cookies. Many thanks to all who offered advice. Most appreciated. I put this here because someone deleted this as an answer.

Facebook WebGL Game + Facebook Simple Hosting + CORS. Possible?

Note: Solved - question makes no sense, my understanding of CORS was incorrect and lead me to ask this question.
The answer is simple as pointed out by #CBroe below - CORS needs to be configured on the game server (in the example in this qestion).
I have a Facebook WebGL game that I'm wanting to host using Facebook's simple hosting (https://developers.facebook.com/docs/games/services/contenthosting/).
Is it possible to use Facebook's Simple Hosting for a WebGL game and still contact my web server (mygamedomain.com)? Is there somewhere in the FB app config to specify domains to allow?
Is the only way to get around this to serve the game from mygamedomain.com also?
I'd really like to avoid serving the game from my webserver if possible.
Any ideas or suggestions?
Not doing so will generate an error as expected:
XMLHttpRequest cannot load https://mygamedomin.com/mygame.php. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://apps-1287636812638.apps.fbsbx.com' is therefore not allowed access.
Just to be clear as there seems to be some confusion:
Game is hosted by facebook using their "Simple Hosting" service, not on my own server, .
I know CORS is the solution - the question is - does Facebook allow/support this? If so where do I configure the domains to allow.
If this was on my own server I the answer is trivial - CORS. But it's not.
There are hacks to circumvent cross-origin restrictions - I'm not looking for these. There's plenty of resources already covering these.
Edit: changed the title to more accurately reflect my question.
CORS is the solution to your problem here.
This question/the answer is not Facebook specific - the issue would be the same with any other domain serving your content, that is different from your own.
Your client-side code is hosted under the Facebook domain, and tries to make a request to your domain - that is the cross-domain part. Your domain is the party that holds the power to either allow or deny this request - by default, it would be denied, but by responding with the appropriate header, your server can signal to the browser, "yes, that's ok, he [your code running under facebook.com] is one of the good guys ..."
So you need to configure this on your server, that you want to make the request to.

API key not allowed when using Weather service

I built a simple Node.js app that worked with the Weather service. It worked fine for a while, but about 24 hours ago started returning this error:
{"metadata":{"version":"1","transaction_id":"1:1362317376","status_code":401},"success":false,"errors":[{"error":{"code":"AGW-0210","message":"Api not allowed for this api key."}}]}
I've double checked my authentication information and it is correct.
The 401 response indicates authentication failed. But it may also have been the service unavailable or a plan limit reached. Are you still seeing this problem? Is it intermittent? or continuously failing?
There is a brief explanation of the throttling of the API when it hits the limits of the plan that you selected. See here, in the bottom paragraph of the first section.
You can check the status of the Bluemix platform here.
I found a workaround for me, just delete the old service and create a new one.
This works fine for me.

Does the TimeActivity query in the QBO v3 API work?

I want to love the v3 API. Unfortunately, when making the seemingly simple call:
service.executeQuery("select * from TimeActivity");
I get the crushing reply of:
<Error code="6002">
<Message>message=Timeout occurred while proxying request; errorCode=006002; statusCode=504</Message>
</Error>
What kind of problem could cause this?
Typically a 504 error code indicates there is a dependency timeout. It is clear that the server you are contacting is responsive, as you are receiving the response.
This kind of error is common if there is any kind of fault in the back end of the server or some service they rely on has gone down. You may want to contact the system administrator or responsible support team to ask about this, as it's likely affecting anyone accessing the same service as you.
It looks like something is wrong with my account. All TimeActivity queries fail in the API explorer. To Intuit support I go!

Graph API requests failing / facebook dns?

The facebook graph api (graph.api.com) resolves to 173.252.101.18 almost every time. However, in some cases the DNS result ends up in 69.171.228.44. The latter host does not respont, is not ping-able and thus, sometimes API requests fail.
A friend (which is a facebook app developer as well) confirmed this behavior with his server. Another friend's DNS simply did not resolve to 69.171.228.44, so he had no problems.
What could i do? any suggestions?
You could try to intercept the cases where it fails and retry resolving or just use a static preprogrammed IP (if you notice failure). It's just a stop-gap method but it seems to me the problem lies with facebook's (DNS) servers so a full fix of the problem at your side is difficult