0 Replies Latest reply on Oct 13, 2015 12:11 PM by chall

    How to upload a file - Jive API V2

    chall

      I keep getting 404s when trying to upload a file. I'm using the method outlined here (OpenClient REST API )

       

      Am I missing something? Any insight is appreciated.

       

      import json, base64, requests
      
      uri = "/api/core/v2/attachments"
      
      base_url = "https://mydomain.org"
      url = base_url + uri
      
      user = "username"
      password = "password"
      
      auth = "Basic " + base64.encodestring('%s:%s' % (user, password)).replace("\n","");
      
      headers = { "Content-Type": "application/json", "Authorization": auth, "body": open('report.txt', 'rb') }
      
      
      
      req = requests.post(url, headers=headers )
      
      print req.text
      print req