AnsweredAssumed Answered

Issue in creating blog using REST API

Question asked by pradeepsimha on May 6, 2014
Latest reply on May 6, 2014 by pradeepsimha
Hi,

I am trying to create blog post programmatically using REST API, the url is like below:

/alfresco/service/api/blog/site/{site}/{container}/posts


When I post the URL I am getting below exception:


{
    "status": {
        "code": 500,
        "name": "Internal Error",
        "description": "An error inside the HTTP server which prevented it from fulfilling the request."
    },
    "message": "04060020 Wrapped Exception (with status template): null",
    "exception": "org.springframework.extensions.webscripts.WebScriptException - 04060020 Wrapped Exception (with status template): null",
    "callstack": [
        "",
        "java.lang.NullPointerException",
        "org.alfresco.repo.web.scripts.blogs.posts.BlogPostsPost.parsePostParams(BlogPostsPost.java:95)",
        "org.alfresco.repo.web.scripts.blogs.posts.BlogPostsPost.executeImpl(BlogPostsPost.java:72)",
        "org.alfresco.repo.web.scripts.blogs.AbstractBlogWebScript.executeImpl(AbstractBlogWebScript.java:294)",
        "org.springframework.extensions.webscripts.DeclarativeWebScript.execute(DeclarativeWebScript.java:64)",
        "org.alfresco.repo.web.scripts.RepositoryContainer$3.execute(RepositoryContainer.java:429)",
        "org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)",
        "org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecute(RepositoryContainer.java:491)",
        "org.alfresco.repo.web.scripts.RepositoryContainer.transactionedExecuteAs(RepositoryContainer.java:529)",
        "org.alfresco.repo.web.scripts.RepositoryContainer.executeScript(RepositoryContainer.java:341)",
        "org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:378)",
        "org.springframework.extensions.webscripts.AbstractRuntime.executeScript(AbstractRuntime.java:209)",
        "org.springframework.extensions.webscripts.servlet.WebScriptServlet.service(WebScriptServlet.java:132)",
        "javax.servlet.http.HttpServlet.service(HttpServlet.java:727)",


I tried to add parameters like title, content etc. But still I get the same error. My question is, what is the correct syntax for creating blog post using REST API? This URL: http://docs.alfresco.com/4.1/index.jsp?topic=%2Fcom.alfresco.enterprise.doc%2Freferences%2FRESTful-intro.html doesn't explain in brief what all the parameters I need to pass. Can anyone kindly guide me in this?

Outcomes