0 Replies Latest reply on Sep 21, 2015 5:52 PM by asiddacharya

    ExecuteBatch API for discussions

    asiddacharya

      Hi All,

       

      I need help, I have requirement to post 400+ discussions along with multiple reply's (messages), I am trying to achieve this with executeBatch API. Below is the sample code which I am running, when I run the below Json content it creates discussion but not the message. It throws 400 error message. Can you please help me here?

       

       

       

       

      [ {

              "key": "discussion",

              "request": {

                  "method": "POST",

                  "endpoint": "/api/core/v3/contents",

                  "body":{  "visibility":"place",

                               "parent":"https://XXXXXX.com/api/core/v3/places/628184",

                                 "type":"discussion",

                                  "subject":"Test discussion 5",

                                   "content":{"type":"text/html","text":"<body><p>Batch Test</p></body>"}

                             }

                  }               

          },

      {

              "key": "messages",

              "request": {

                      "method": "POST",

                      "endpoint": "/api/core/v3/messages",

                       "body":{

                          "type":"message",

                          "parent":"${discussion:$.resources.messages.ref}",

                          "content":{"type":"text/html","text":"<body><p>Test Message 1</p></body>"}

                        }

                   }

      } ]

       

      Thanks,
      Anand