19 Replies Latest reply on Aug 27, 2019 2:21 PM by rachakonda03

    How to use the API to upload a file from the local filesystem?


      I would like to be able to automate the upload of PDFs to jive using the API. I have found a way to create new documents, and add attachments from a public url. Using something like the following json format as the data for an API request works for those two things. Is there a parallel method for uploading something from a local filesystem?

          data = json.dumps(

      data= json.dumps(  
         { "content": {
                 "type": "text/html",
                 "text": "<body><p>Upload a file using the API</p></body>"
             "subject": "Upload a file using the API",
             "visibility": "place",
             "parent": "%s/api/core/v3/places/2801" % base_url,
             "attachments" : [{
                 "name" : "Test.pdf",
                 "type" : "attachment",
                 "contentType" : "application/pdf",
                 "url" : "https://www.foo.bar/test.pdf",
                 "doUpload" : "true"}],
             "type": "document"