0 Replies Latest reply on Sep 29, 2016 7:44 AM by itayy

    upload video with java unirest and jive api- example



      i will just put this here.

      code to upload video with jive rest api and unirest using java

      import java.io.File;
      import com.mashape.unirest.http.HttpResponse;
      import com.mashape.unirest.http.JsonNode;
      import com.mashape.unirest.http.Unirest;
      import com.mashape.unirest.http.exceptions.UnirestException;
      public static void main(String[] args)  {
           HttpResponse<String> jsonResponse;
                try {
                     jsonResponse = Unirest.post("https://your-Url/api/core/v3/{method}")
                     .routeParam("method", "contents")
                     .basicAuth("user", "pass")
                     "{'type': 'video',"
                          +"'parent' : 'https://your-Url/api/core/v3/places/PlaceID', "
                          +"'subject': 'name of the new video',"
                          +"'content':{ 'type': 'text/html', 'text': '<body><p>main text of video</p></body>'}}",
                     .field("file", new File("c:/my-Vid.mp4"))
                } catch (UnirestException e) {



      PlaceID = replace with the id of the place you want to put the video in

      your-Url = the URL of your community