# REST: Error parsing xhtml: Unexpected character '\\\\'

**URL:** <https://community.developer.atlassian.com/t/rest-error-parsing-xhtml-unexpected-character/58460>\
**Category:** Confluence Cloud\
**Tags:** rest-api\
**Created:** [May 19, 2022, 9:34pm UTC](https://community.developer.atlassian.com/t/rest-error-parsing-xhtml-unexpected-character/58460 "2022-05-19T21:34:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![AlecTremblay](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/alectremblay/32/45298_2.png) [@AlecTremblay](https://community.developer.atlassian.com/u/AlecTremblay)\
**Post date:** [May 19, 2022, 9:34pm UTC](https://community.developer.atlassian.com/t/rest-error-parsing-xhtml-unexpected-character/58460/1 "2022-05-19T21:34:19Z")

</div>

Hello,

I’ve been working on creating a page in Confluence from a template with REST. I’ll been using the approach from [this thread](https://community.atlassian.com/t5/Confluence-questions/How-can-i-create-a-new-page-from-a-users-template-using-rest-api/qaq-p/1059884)

When I pass in a format that contains only text, the code works and creates the page correctly. However, when I pass in a format with a macro, I get a response like this:

```auto
"message": "com.atlassian.confluence.api.service.exceptions.BadRequestException: Error parsing xhtml: Unexpected character '\\' (code 92) in start tag Expected a quote\n at [row,col {unknown-source}]: [1,509]"

```

---

<div class="post-metadata">

**Author:** ![AlecTremblay](https://sea1.discourse-cdn.com/atlassiandeveloper/user_avatar/community.developer.atlassian.com/alectremblay/32/45298_2.png) [@AlecTremblay](https://community.developer.atlassian.com/u/AlecTremblay)\
**Post date:** [May 24, 2022, 2:23pm UTC](https://community.developer.atlassian.com/t/rest-error-parsing-xhtml-unexpected-character/58460/2 "2022-05-24T14:23:21Z")

</div>

\_bump
