2 Replies Latest reply on Sep 4, 2013 12:28 AM by jayati453

    How do I create discussion from jiveapp REST API v2

    jayati453

      I have created an app. And now from this app I wanted to create a discussion on jive community just by clicking on a button. There is not any form kind of thing all the details will come from somewhere.

       

      I am getting a HTTP 400 error.

      Capture.PNG.png

        

      CODE :

         var params = {};

         var postdata = {subject: case_sub, html:"<body>hi</body>" , question: "false"};

         var postdata1 = gadgets.io.encodeValues(postdata);

         console.log("In create discussion postdata" + postdata1);

         params[gadgets.io.RequestParameters.METHOD] = gadgets.io.MethodType.POST;

         params[gadgets.io.RequestParameters.POST_DATA]= postdata1;

         gadgets.io.makeRequest("http://1.1.1.1/api/core/v2/groups/1010/discussions", response, params);

       

       

        function response(obj) {

        /** obj.data contains an object corresponding with the JSON-encoded response **/

        console.log("In response of create discussion");

        console.log(obj);

       

          };

       

      Please reply.