Uploading an Excel Spreasheet to the CMS Repository

Uploads and stores a Microsoft Excel spreadsheet to the CMS repository.

Request

POST <webi_URL>/spreadsheets

Request type: multipart/form-data

The request body is a multipart body made of the following parts:

  • The spreadsheet details, which can be XML or JSON. Only name, folderId elements are mandatory. description is optional. The other spreadsheet elements are ignored.
  • The spreadsheet itself as a binary stream. Content-Type is either application/vnd.ms-excel for Microsoft Excel 2003, or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for Microsoft Excel 2007.
Response

Response type: application/xml or application/json

The response is a message stating the success or failure of the request.

Example

XML request body for a Microsoft Excel 2007 spreadsheet:

--10f3211b-66e8-4b14-93ec-b11ec5c19a43-41d3c84c-d157-4377-aba9-41353b9a4dfe
Content-Disposition: form-data; name="attachmentInfos"
Content-Type: application/xml
<spreadsheet>
    <name>myfile.xlsx</name>
    <folderId>6206</folderId>
</spreadsheet>
--10f3211b-66e8-4b14-93ec-b11ec5c19a43-41d3c84c-d157-4377-aba9-41353b9a4dfe
Content-Disposition: form-data; name="attachmentContent"
Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
... Excel 2007 document as a binary stream...
--10f3211b-66e8-4b14-93ec-b11ec5c19a43-41d3c84c-d157-4377-aba9-41353b9a4dfe--

XML response:

<success>
    <message>The resource of type 'Spreadsheet' with identifier '7466' has been successfully created.</message>  
    <id>7466</id> 
</success>

JSON request body for a Microsoft Excel 2003 spreadsheet:

--10f3211b-66e8-4b14-93ec-b11ec5c19a43-41d3c84c-d157-4377-aba9-41353b9a4dfe
Content-Disposition: form-data; name="attachmentInfos"
Content-Type: application/json
{"spreadsheet":{"name":"myfile.xls","folderId":6206}}
--10f3211b-66e8-4b14-93ec-b11ec5c19a43-41d3c84c-d157-4377-aba9-41353b9a4dfe
Content-Disposition: form-data; name="attachmentContent"
Content-Type: application/vnd.ms-excel
... Excel 2007 document as a binary stream...
--10f3211b-66e8-4b14-93ec-b11ec5c19a43-41d3c84c-d157-4377-aba9-41353b9a4dfe--

JSON response:

{"success":
    {"message":"The resource of type 'Spreadsheet' with identifier '7492' has been successfully created.",
     "id":7492
    }
}