2 Replies Latest reply on Sep 22, 2015 4:22 PM by james.dellow

    Uploading attachments via the REST API Content Service using multipart/form-data?

      Does anyone have any tips or tricks for uploading attachments via the REST API Content Service in Jive cloud under the following scenario:

      • multipart/form-data using javascript (NOT Curl) - see "Create Document with an Attachment using multipart/form-data" under Jive REST API v3.12 → Attachment entity
      • the files are being uploaded from the local file system
      • cross-domain (i.e. isn't hosted in Jive)

       

      This is the basic call I'm making:

      request = $.ajax('https://theJiveInstance.jiveon.com/api/core/v3/contents/', {
           method: 'POST',
           contentType: false,
           processData: false,
           data: formData
      });
      

       

      The response from the server is 403 Forbidden and:

      {
        "code" : 4026,
        "message" : "The request could not be validated as originating from within the SBS application"
      }
      

       

      I can replicate this both with my code and using tools like Postman. I've also tried adding basic auth.

       

      It is only this scenario that is affected - other API functions are working ok, including:

      • Create content (no attachments) works
      • Upload attachments via a URL works

       

      Is this just a bug in Jive?