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-to Use REST API to insert Multiexcerpt? Edited

I have been using the REST API to build, and modify pages in the following manner using curl:

1) GET the content for entire page

2) modify the content programmatically

3) PUT the content for the entire page.

I have successfully added anchors, but when I try using the Multiexcerpt code, I get a Internal Server error. Is adding a Multiexcerpt possible through the API?

$ curl -H "Authorization: Basic <token>" -X PUT -H 'Content-Type: application/json' -d @test4_body.html https://conuence.oraclecorp.com/confluence/rest/api/content/1666019278
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3765 0 64 100 3701 60 3484 0:00:01 0:00:01 --:--:-- 3545{"stusCode":500,"message":"","reason":"Internal Server Error"}

I have captured the body.storage.value and use it as a template to make the modifications.

{"id":"1666019278","type":"page", "title":"Features Test","space":{"key":"NEWFT"},"body":{"storage":{"value": "<h2>Big Data and Data Warehousing Solutions</h2><h3 class="ulchildlink" style="margin-left: 30.0px;">Parallelism and Scalability</h3><p><a href="https://confluence.oraclecorp.com/confluence/display/ODNF20C/Oracle+Database+20c+New+Features+Guide#OracleDatabase20cNewFeaturesGuide-75912-1"><ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="3ef54d49-f5e4-4ef1-a3e2-2dc1f51dc5ab"><ac:parameter ac:name="">75912-1</ac:parameter></ac:structured-macro></a></p><h4 style="margin-left: 60.0px;"></h4><ac:structured-macro ac:name="multiexcerpt" ac:schema-version="1" ac:macro-id="066556c6-3949-4dc2-98ac-0e0b96579f08"><ac:parameter ac:name="MultiExcerptName">75912-1</ac:parameter><ac:parameter ac:name="atlassian-macro-output-type">INLINE</ac:parameter><ac:rich-text-body><h4 style="margin-left: 60.0px;"><span style="color: rgb(0,0,255);"><ac:inline-comment-marker ac:ref="89750444-ab32-4ec5-9f86-d0cc9a2965e4">75912-1 Enhanced Parallel Execution Applicability</ac:inline-comment-marker></span></h4><p style="margin-left: 60.0px;"><ac:inline-comment-marker ac:ref="89750444-ab32-4ec5-9f86-d0cc9a2965e4">Parallel execution can now be used for Blah, blah, blah....</ac:inline-comment-marker></p><p style="margin-left: 60.0px;"><ac:inline-comment-marker ac:ref="89750444-ab32-4ec5-9f86-d0cc9a2965e4">BLah, blah blah.</ac:inline-comment-marker></p><p style="margin-left: 60.0px;"><strong><ac:inline-comment-marker ac:ref="89750444-ab32-4ec5-9f86-d0cc9a2965e4">Related Topics: </ac:inline-comment-marker><a href="https://docs-uat.us.oracle.com/en/database/oracle/oracle-database/20/inmem/optimizing-queries-with-join-groups.html"><span class="italic"><ac:inline-comment-marker ac:ref="89750444-ab32-4ec5-9f86-d0cc9a2965e4">Oracle&reg; Database VLDB and Partitioning Guide</ac:inline-comment-marker></span></a></strong></p></ac:rich-text-body></ac:structured-macro><p style="margin-left: 60.0px;"><strong><a href="https://docs-uat.us.oracle.com/en/database/oracle/oracle-database/20/inmem/optimizing-queries-with-join-groups.html"></a></strong></p><p><strong><span class="italic"><ac:inline-comment-marker ac:ref="89750444-ab32-4ec5-9f86-d0cc9a2965e4"><ac:structured-macro ac:name="anchor" ac:schema-version="1" ac:macro-id="f880d7ba-9d54-41d3-a57f-2ee1b62fb5b6"><ac:parameter ac:name="">74396-1</ac:parameter></ac:structured-macro><br /></ac:inline-comment-marker></span></strong></p><h4 style="margin-left: 60.0px;"><span style="color: rgb(0,0,255);">74396-1&nbsp;Deep Vectorization</span></h4><p style="margin-left: 60.0px;">Oracle Database optimizes Blah, Blah, Blah. </p><p style="margin-left: 60.0px;">Blah, blah, blah.</p><p style="margin-left: 60.0px;"><strong>Related Topics: <a href="https://docs-uat.us.oracle.com/en/database/oracle/oracle-database/20/inmem/optimizing-queries-with-join-groups.html#GUID-55F66F65-1568-4B53-B79E-F841B94659CA">Oracle&reg; Database In-Memory Guide</a></strong></p><h2>Uncategorized</h2>","representation":"storage"}}, "version":{"number":8}}

 This is the failing body.storage.value (test4_body.html).

Note: I have found that the value fails is there are any newlines in the string.

0 answers

Suggest an answer

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

What project did you transition or start on Confluence with the shift to remote work?

It’s been great to hear from fellow users over the last few weeks about the best tips and fun moments you’ve had working on Confluence since the transition to working remote. I’d love to keep the c...

157 views 3 8
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