403 when writing comments to stories / attaching images

Here’s the response when trying to write a story on a task:
‘\n’ +
‘\n’ +
‘ERROR: The request could not be satisfied\n’ +
‘\n’ +

403 ERROR

\n' +

The request could not be satisfied.

\n' +
\n' + Request blocked.\n' + "We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.\n" + '
\n' + 'If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.\n' + '
\n' + '
\n' + '
\n' +
'Generated by cloudfront (CloudFront)\n' +
'Request ID: Y1V4nt8qsb2EaYzYyf6wF3LkswplyouGD7ugG-EH9kHNTTyQR650NQ==\n' +
'
\n' + '\n' + '\n' + '' status: 403

This was returned as a result of this request:
Error: Error posting HTML to Asana: AxiosError: Request failed with status code 403
Timestamp: 2025-02-21T17:38:36.882017Z
Function: screenshot
ExecutionId: alw12fge1ij2

Stack trace:

  • at settle (/workspace/node_modules/axios/dist/node/axios.cjs:2026:12)
  • at IncomingMessage.handleStreamEnd (/workspace/node_modules/axios/dist/node/axios.cjs:3142:11)
  • at IncomingMessage.emit (node:events:530:35)
  • at IncomingMessage.emit (node:domain:552:15)
  • at endReadableNT (node:internal/streams/readable:1698:12)
  • at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
  • at Axios.request (/workspace/node_modules/axios/dist/node/axios.cjs:4252:41)
  • at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  • at async postHTMLToAsana (/workspace/index.js:424:22)
  • at async handleDomainSearch (/workspace/index.js:65:5)
  • at async exports.screenshot (/workspace/index.js:36:18)

Error details:

Request payload:
{
“data”: {
“html_text”: "asanabot says:

KeywordTypeURLOrganic RankLocal RankAbsolute Rank
local seo servicesorganic<a href="https://www.sterlingsky.ca/local-seo/\“>https://www.sterlingsky.ca/local-seo/</a></td><td>9</td><td>null</td><td>15</td></tr></table></body>”
}
}

Hi @Noah_Learner,

Unfortunately the forum software garbled the content of your request so we can’t see what you actually submitted, but be sure you are following the docs for writing rich text. For one thing, I’m not sure if you wrapped your html_text in a <body></body> tag; again, hard to tell from the post. Also be sure to check the list of supported tags; there are a lot of HTML tags which Asana does not support.

1 Like

I wrapped my rich text / html in a and the forum tool didn’t make it easy to share code.

Which was made worse by the fact that I couldn’t edit the post after it went live.

The core issue to debug here is the cloudfront error that is a 403. It started for us earlier this week when we were trying to create stories / attachments via api.

The message made me think that your system was overwhelmed.

The error Message: “Request blocked. We can’t connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner. If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation. Generated by cloudfront (CloudFront). Request ID: Y1V4nt8qsb2EaYzYyf6wF3LkswplyouGD7ugG-EH9kHNTTyQR650NQ==”

Can your dev / API team look at that request ID to see what happened?

I don’t work for Asana, I’m a third-party developer like you (but I have a lot of experience with the Asana API).

I can’t say for sure but this:
ERR_BAD_REQUEST

still leads me to believe the issue is in the format/syntax of what you’re trying to send. “Bad request” is what one gets when one sends rich text that’s not formatted to Asana’s exact specs, or tries to upload an attachment that’s not done in the exact right way (attachments can be especially tricky).

If you haven’t yet, I would start simple and build from there; that is, add a story with just a simple plain text sentence and make sure you can do that successfully. Then add some rich text and make sure that works. Save attachment uploading for the last testing.

1 Like