My tool just stopped working from today and now it’s showing up this message:
Array ( [errors] => Array ( [0] => Array ( [error] => html_lacks_body [message] => Rich text should be wrapped in tag. [help] => For more information on API status codes and how to handle them, read the docs on errors: https://asana.com/developers/documentation/getting-started/errors ) ) )
I’m using this field to create a task html_notes… this is the whole code:
$s = new Asana();
$s->url .= "tasks";
$s->fields['assignee'] = $getAsanaUsers["data"][$keyAsanaManager]["id"]; //1o usuário
//$s->fields['notes'] = "hi";
$s->fields['name'] = $HarvestTaskName;
$s->fields['workspace'] = $WorkSpace; //Empresa SLM
$s->fields['projects'][0] = $idProject; //empresa Aurora
$s->fields['html_notes'] = $HarvestNotes;
Any idea what is going on? I think they changed something…
1 Like
Hi @Cezar_Ayran,
This error is related to a new API feature we rolled out today. Please read about the change over in the official announcement thread or the API docs for rich text. To be notified by email of future change and deprecations, you can sign up for our developer newsletter. Sorry for the trouble!
1 Like
Hi Joe,
Is not clear. I see that the filed html_notes is still there. And I also tried putting just text (no html) and I’m still getting this error. What do I have to change?
This is my header:
$this->headers = array(‘Authorization: Bearer ‘.$arIntegration->AsanaBearer.’’, ‘Asana-Enable: new_rich_text’);
I just changed it to ‘Asana-Disable: new_rich_text’ and it worked lol
I’d like to use the new feature but is not clear for me. Tks!
If you’re writing to any html_notes
, html_text
, or html_description
field, then you’ll need to either:
- use the new format for rich text, or
- send an
Asana-Disable: new_rich_text
to continue using the old format.
Note that the second option will only be available for two more months before the new format becomes permanently enabled.
If you want to write plain text, you need to write to the notes
field only and not the html_notes
fields
1 Like
ohh that’s crazy lol. To use the new format instead of html_notes what is the new name of this field?
I think I got it… It’s the same field but the content of the field has to be sent between <body>
and also add to the header ‘Asana-Enable: new_rich_text’
1 Like
It’s the same html_notes
field, but the data you write to it needs to be in a new format. Instead of, for example, This is <STRONG>HTML</STRONG> notes.
you would need to write <body>This is <strong>HTML</strong> notes.</body>
. The documentation has the full description of this new format and the valid tags.
2 Likes
I had the same issue this morning, I was missing the <body>
wrappers