Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How use HTML macro through curl

Hi,

I am trying to update confluence page through curl command, but facing below issue.

Please assist me else let me know how to update html iframe tag using curl command.

Thanks

Code:
curl -u user:passwd -X PUT -H 'Content-Type: application/json' -d'{"body": {"storage": {"representation": "storage", "value": "<ac:structured-macro ac:name=\"html\" ac:schema-version=\"1\" ac:macro-id=\"9b345ba9-a013-4984-9eb3-d4c3f89d3986\"><ac:plain-text-body><iframe width=\"100%\" height=\"225px\" style=\"border: none\" src=https://test.in:28185/CR/CR1777871></iframe></ac:plain-text-body></ac:structured-macro><ac:structured-macro ac:name=\"html\" ac:schema-version=\"1\" ac:macro-id=\"95a008e2-1831-4405-8a32-73ddffa89495\"><ac:plain-text-body><iframe width=\"100%\" height=\"225px\" style=\"border: none\" src=https://test.in:28185/CR/CR1777870></iframe></ac:plain-text-body></ac:structured-macro>"}},"space": {"key": "KEY_NAME"}, "title": "TEST1", "version": {"number": 8}, "type": "page", "id":"168016254"}' https://confluence.in/rest/api/content/168016254

Error:

{"statusCode":400,"data":{"authorized":false,"valid":true,"errors":[],"successful":false},"message":"Error parsing xhtml: Unexpected character 'h' (code 104) in start tag Expected a quote\n at [row,col {unknown-source}]: [1,511]"}

 

1 answer

0 votes
Minh Tran Atlassian Team Apr 05, 2018

@Alok Singh Has you tried to update the above bodyContent via an external json file? I guess your above json having some invalid format.

Try it with a json file and you don't need to escape it like the direct json string for curl

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Posted in Confluence Cloud

Please tell us how you use Confluence space settings

Hi there, a few of us at Atlassian would love to learn about how you use "space settings" functionality in Confluence. A facelift to the space settings is long overdue and we want to start with impro...

244 views 8 7
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you