3 Replies Latest reply on Apr 23, 2018 2:42 PM by ganeshk1

    How to POST a document with an excel sheet attachment

    ganeshk1

      Hi,

       

      I have tried all the online resources. I am trying to POST a document (html) with an excel  (.xlsx) attachment .

       

      The server either throws a 400 or 500 errors.

       

      I tried doing the following

      1. create document and attachment using POST  /contents itself using JSON the describe the attachment as well.

      2. multipart with the document and attachment as two parts using  POST /contents api

      3. Also tried doing /attachments/content/{contentid}    - to add an excel attachment to an existing document

       

      Please guide me to an document or an example that will help me resolve this issue.

       

      The details of my env:

      {

        "jiveVersion" : "9.0.1.0 ",

        "jiveCoreVersions" : [ {

        "version" : 2,

        "revision" : 3,

        "uri" : "/api/core/v2",

        "documentation" : "https://developers.jivesoftware.com/api/v2/rest"

        }, {

        "version" : 3,

        "revision" : 100,

        "uri" : "/api/core/v3",

        "documentation" : "https://developers.jivesoftware.com/api/v3/rest"

        } ],

        "instanceURL" : "https://community.jivesoftware.com",

        "jiveEdition" : {

        "product" : "on-prem",

        "tier" : 0

        }

      }

       

      Getting the following error with multipart request  (https://developers.jivesoftware.com/api/v3/cloud/rest/DocumentEntityUsage.html)how the multipart is setup on Advanced Rest client in chrome browser

       

      {

      "error": {

      "message": "MultipartBody request should include one application/json part"

       

      "status": 400

      }

      }

       

      Thanks

       

      Ganesh