Recent searches
No recent searches
Importing HTML
Posted Mar 30, 2021
Hi everyone,
I'v read a lot on the community and saw some tips & tricks.
Unfortunately without any result.
I've exported an article into JSON to CSV and tried to import the "xml" into the tag body.
Without success.
This was my initial code (in postman), it didn't worked error 422.
{
"translation": {
"locale": "{{locale}}",
"title": "{{title}}",
"body": "{{description}}"
}
}
So I removed the "Body" & tried again, the article was created.
I knew that the issue is linked to what was available into the CSV.
So I tried to hardcode it (after deleting the language into the guide ofcourse):
{
"translation": {
"locale": "{{locale}}",
"title": "{{title}}",
"body": "
"
<p>Assigning clients to your employees allows them to work only on the documents of the clients you choose.</p>\n<p>Employees will only see the documents of the clients they've been assigned.</p>\n<ul>\n<li>Go to the <em><strong>Clients</strong> </em>menu<br><img src="https://banqup.zendesk.com/hc/article_attachments/360021209620/297-.png" alt="297-.png"><br> </li>\n<li>Click on a client<br><br>\n</li>\n<li>Under <em><strong>Assign collaborators</strong></em>, click anywhere in the <em><strong>Select</strong> </em>box<img src="https://banqup.zendesk.com/hc/article_attachments/360021226579/298-.png" alt="298-.png"><br> </li>\n<li>Choose which employee(s) you want to assign to the client<img src="https://banqup.zendesk.com/hc/article_attachments/360021209600/296-.png" alt="296-.png"><br> </li>\n<li>Save.</li>\n</ul> |
}
}
This didn't helped and same issue, so I tried to remove some HTML data, to be sure that the API accepts HTML. And even added bold to the text to be sure its recognized.
{
"translation": {
"locale": "{{locale}}",
"title": "{{title}}",
"body": "
"
<p><b>Assigning clients to your employees allows them to work only on the documents of the clients you choose.</b></p> |
}
}
Article was succesfully created.
Now back to basics, I've tried it on a different way, browsed through the UI, took the HTML into the UI and copy pasted it in postman. Same error 422.
I can see that my code changes color in postman at this location:
<img src="https://banqup.zendesk.com/hc/article_attachments/360021209620/297-.png" alt="297-.png"> so I'm pretty sure its linked to whats inside that.
But how can I easily export all the articles from zendesk & easily re-import them ?
So they are created into another language? (For example en-001 to en-gb)
0
3
3 comments
Francois Spinnael
I've made a second test, just by removing the tag IMG,
without <img> it works fine...
0
Francois Spinnael
Ok found the solution, the result of the JSON is with double brackets " "
And in order to import them, I've had to use single brackets ' ' in the XML code...
Stupid noob mistake, but it can maybe help others.
0
Greg Katechis
Thanks for updating this with your solution! There are no stupid mistakes, only mistakes that seem stupid in retrospect!
1