10 Replies Latest reply on Sep 7, 2013 11:50 AM by ignacio

    Copying files from one group to another via REST API?

    ignacio

      Hi Max Calderon,

       

      thanks a lot for replying! As you suggested, I'm bringing Mark Weitzel, Clara Liang and Victoria Blake into this discussion.

       

      I have a question that I would love your thoughts on if you have the time. Thanks so much in advance!

       

      In our customization efforts to match Jive to our processes, we are trying to copy files from one group to another group but are having trouble achieving it. We are using the REST API for this. 

       

      1) We are calling the following service:

       

      https://vecosio.jiveon.com/api/core/v3/contents

       

      2) This is the body of the POST request:

       

      With a public file it works fine.

       

      { "content" : { "type" : "text/html", "text" : "<p>Hi</p>" },
      "subject" : "TEst Url2" ,
      "parent" : "https://vecosio.jiveon.com/api/core/v3/places/2404", 
      "type" : "file" , 
      "attachments": [ {   "doUpload": true,  "url": " http://www.publicdomainpictures.net/pictures/10000/nahled/1-1192354273.jpg "  } ]  }

       

      But with a file that already resides in a Jive group, it does not work.

       

      { "content" : { "type" : "text/html", "text" : "<p>Hi</p>" },
      "subject" : "TEst Url2" ,
      "parent" : "https://vecosio.jiveon.com/api/core/v3/places/2404", 
      "type" : "file" , 
      "attachments": [ {   "doUpload": true,  "url": "https://vecosio.jiveon.com/api/core/v3/attachments/file/2506/data"  } ]  }

       

      3) We get the following error message

       

      {"error":{"message":"There was an error fetching file https://vecosio.jiveon.com/api/core/v3/attachments/file/2506/data. HTTP error code: 401","status":400}}, status=400, statusMsg=Bad Request, url=https://vecosio.jiveon.com/api/core/v3/contents}

       

      Do you have any suggestions? Maybe copying files works differently? Is there a standard working example that we could use?

       

      I very much look forward to your reply! Thanks a lot in advance,

       

      Ignacio