Hello,
I’m trying to insert external links in the the html_notes parameter in the create task API, but I’m getting the following JSON error:
{u'errors': [{u'message': u'Could not parse request data, invalid JSON', u'help': u'For more information on API status codes and how to handle them, read the docs on errors: https://developers.asana.com/docs/errors'}]}
Here’s the html_note parameter I’m sending:
"html_notes": "<body> <ul> <li><strong><a href=\"https://zm.quickbase.com/db/bs938uf69?a=dr&rid={{a.id}}\">View Quickbase record</a></strong> </li> </ul> </body>"
I’ve tried looking at similar forum topics and reach Asana documentation but couldn’t find a definite answer.
lpb
May 5, 2023, 6:07pm
2
@PolarBear ,
This works:
"<body><a href=\"https://google.com\">View page</a></body>"
I just removed your </strong> </li> </ul>
from the string.
curl --request POST \
--url https://app.asana.com/api/1.0/tasks \
--header 'accept: application/json' \
--header 'authorization: Bearer xxxxxxxxxxxx' \
--header 'content-type: application/json' \
--data '
{
"data": {
"projects": [
"<gid>"
],
"name": "test",
"html_notes": "<body> <a href=\"https://google.com\">View page</a></body>"
}
}
'
Larry
Thanks @lpb . I just realized I forgot to copy over the beginning tags.
Is there any way to have the link as a bolded unordered list item? Because the html_body will have several items so it looks better as a list.
I tried the following but getting the same error response:
"html_notes": "<body> <ul> <li><strong><a href=\"https://google.com\">View page</a></strong> </li> </ul> </body>"
lpb
May 5, 2023, 6:30pm
4
That works for me:
Your problem must be elsewhere in your call.
You can test via the right sidebar at
The rich text you indicate here is fine, but for comprehensive info:
Larry
Thanks soo much @lpb ! After some testing, I found out it was an issue with JSON format, not the a href.
I do testing on Postman, so I forgot to copy over the ending }…lol. My excuse is that it’s Friday
1 Like
system
Closed
May 12, 2023, 7:14pm
7
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.