Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8060065
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T09:52:01+00:00 2026-06-05T09:52:01+00:00

I need to create (with XWiki API REST) a BlogPost. But I don’t know

  • 0

I need to create (with XWiki API REST) a BlogPost. But I don’t know to use REST…
With this command :

$ curl -u Admin:admin -X PUT --data-binary "@newpage.xml" -H "Content-Type: application/xml" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Main/pages/NewPage

and with this XML file :

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<page xmlns="http://www.xwiki.org">     
        <title>Hello world</title>
        <syntax>xwiki/2.0</syntax>
        <content>This is a new page</content>
</page>

I create a Page in the space Main. But I want a BlogPost in the space Blog. What’s the markup that I must use? (I have found this command here)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T09:52:03+00:00Added an answer on June 5, 2026 at 9:52 am

    The right command to use is:

    curl -u Admin:admin -X POST --data-binary "@blogpost.xml" -H "Content-Type: application/xml" http://localhost:8080/xwiki/rest/wikis/xwiki/spaces/Blog/pages/A+New+Blogpost/objects
    

    The XML file should look like:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <object xmlns="http://www.xwiki.org"><className>Blog.BlogPostClass</className>
        <property name="category"><value>Blog.News</value></property>
        <property name="content"><value>This is the new blog post. You can use **wiki syntax** in it.
    
    Don't forget to escape XML entities like &amp; and &lt;!</value></property>
        <property name="publishDate"><value>2012-06-06 12:00:00.0</value></property>
        <property name="published"><value>1</value></property>
        <property name="title"><value>Second blog post</value></property>
    </object>
    

    A few things to note:

    • The document must already exist, this doesn’t work for a non-existing document. So, first thing to do is to PUT a title and parent into a new document, then you can add objects to it.
    • The right verb for creating objects is POST, and the URL is obtained by appending /objects to the document’s REST URL.
    • The actual REST URL of the newly created object is returned as a redirect. You can either intercept the redirect and process the URL as you need, or you can let the redirect go through and you’ll get back the object that was created with the verbose full syntax.
    • In general, when sending resources the same syntax as the one returned when getting resources is used, although not all the data is needed. For instance, I obtained the XML for this object by first getting an existing blogpost object, then removing all that the server doesn’t need to receive since it can compute it locally.
    • One thing I noticed (and I consider a bug) is that when getting resources, XML entities are encoded twice (&amp;#39;), while sent resources should have entities encoded only once (&#39;).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need create custom tabbar with super class UITabBarController. But i don,t know how
I need create clone repository. but I do not know where can I get
I need create a css like this: .word-remain+textarea{clear: before} but I cannot write this
I need create menu for widget like this https://www.gstatic.com/android/market/com.bugabuga.switcher/ss-320-0-0 . What components are used?
this is my first post here. I need create a feed like facebook with
I need create xls-file with own data. But file may already be created, and
I need create a list of RadioButtons, but if I try to do it
I need create WebView which can load a page from Youtube. I don't want
I'm amateur with asp and .net, but i need create a page to generate
I am using this API to create an online image gallery for my application

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.