Solving a CAPTCHA puzzle is required when Trello REST API is called
Asked by ShuFujita:

I use Trello REST API in my Google Apps Script (GAS).

Whenever I change a row in Google Spreadsheets, my GAS catches the event and post the data of the changed row to Trello via post or patch API.

cf. <https://developer.atlassian.com/cloud/trello/rest/api-group-cards/#api-cards-post>

The problem is that sometimes API requests fails and returns HTML (not JSON) response. Especially this happens after I call many requests.

An example of response is as follows.  

```
<!DOCTYPE html>
<html lang="en">
<head>
 <meta charset="utf-8">
 <meta name="viewport" content="width=device-width, initial-scale=1">
 <title>Human Verification</title>
 <style>
body {
 font-family: "Arial";
 }
</style>
 <script type="text/javascript">
window.awsWafCookieDomainList = [];
window.gokuProps = {
"key":"[[FILTERED]]",
"iv":"[[FILTERED]]",
"context":"[[FILTERED]]"
};
</script>
 <script src="https://5648a54233c0.cee742fb.us-west-2.token.awswaf.com/5648a54233c0/946e166377e8/fcd518a0a514/challenge.js"></script>
 <script src="https://5648a54233c0.cee742fb.us-west-2.captcha.awswaf.com/5648a54233c0/946e166377e8/fcd518a0a514/captcha.js"></script>
</head>
<body>
 <div id="captcha-container"></div>
 <script type="text/javascript">
window.addEventListener("load", function() {
const container = document.querySelector("#captcha-container");
CaptchaScript.renderCaptcha(container, async (voucher) => {
await ChallengeScript.submitCaptcha(voucher);
window.location.reload(true);
 }
 );
 });
</script>
 <noscript>
 <h1>JavaScript is disabled</h1>
 In order to continue, you need to verify that you're not a robot by solving a CAPTCHA puzzle.
 The CAPTCHA puzzle requires JavaScript. Enable JavaScript and then reload the page.
 </noscript>
</body>
</html>
```

It seems that Trello API uses AWS WAF CAPTCHA, but there is no way to solving puzzle via JSON REST API.

Is there any way to avoid such requirement of CAPTCHA?


Answers:
author: Alina Kurishko
body: Hi there,

Welcome to the Atlassian Community!

Can you please check if you use the domain name trello.com instead of **api**.trello.com in your requests?

I've seen a similar report recently where updating the domain to **api**.trello.com resolved the issue.

If that doesn't help, could I ask you to create a ticket through [++https://trello.com/contact?++](https://trello.com/contact?) This gives us access to a few more tools to help investigate, and we can discuss information that can't be shared in the community.

Alina \| The Trello Team

comments: author: ShuFujita
body: Thanks to your suggestion, I could resolve this problem.
> Can you please check if you use the domain name trello.com instead of **api**.trello.com in your requests?
>
> I've seen a similar report recently where updating the domain to **api**.trello.com resolved the issue.

I used both trello.com and api.trello.com, and then replace trello.com to api.trello.com. After this change, every request to API returns JSON.

By the way, is API request to trello.com deprecated?


author: Alina Kurishko
body: Yay! Thanks for letting me know about this! Glad to hear the issue's now resolved.

To answer your question, trello.com is not getting deprecated, but Trello has recently been subject to a number of DDoS attacks and as such we've had to quickly add additional IP WAF and DDOS protection on our CDN.

We're working on resolving the issue you experienced but it might take some time until a fix is released.

Alina \| The Trello Team


Tags: json

rest-api