Binary documents can be upload using the Jive v3 API.  This is an example (for Jive 6.x and above) of uploading a local file into a Jive Group using the cURL command from within a shell script.

 

curl -i -v -u ${username}:${password} \

     -F "file=@ConfiguringJivePresent.pdf;type=text/xml" \

     -F "json=@jsonPayload.json;type=application/json" \

     "https://myjivedomain.com/api/core/v3/contents"

 

where the file

jsonPayload.json contains the valid JSON in the following format:

 

{

  "authorship": "author",

  "type": "file",

  "visibility": "place",

  "parent": "https://myjivedomain/api/core/v3/places/51467",

  "subject": "This is my uploaded binary file",

  "tags": [api_upload],

  "content": {

    "type": "text/html",

    "text": "This is my description for the upload file",

    "name" : "a-pdf-file.pdf",

    "size" : "307284"

  }

}

 

There are a number of additional properties you can set and these are document here Jive REST API → File entity

 

Note:  The target Place ID (51467 in the example above) is the Jive unique internal identifier for the Place and has to be first looked up.  This can be done by querying the database table jivebrowsecntr or by calling this Jive Places API.  For example;

 

https://myjivedomain/api/core/v3/places/?filter=entityDescriptor(700,1263)

 

Returns:

{

...

"self" : {

  "ref" : "https://myjivedomain/api/core/v3/places/51467",

  "allowed" : [ "GET", "DELETE", "PUT" ]

  },

...

}

 

Where 1263 is the Group ID visible from the Group edit page in Jive and 51467 is the Place ID unique identifier returned that you need to use in the upload file API call.

 

Note: The procedure for uploading into a Space is the same as for a Group.