Documents API ============= .. contents:: :depth: 2 The Document API supports the process of uploading and editing documents. These documents can be embedded in the post using shortcodes. Supported Document ------------------ By default, the following file types are supported by this API: +--------------+----------------------------------------------------------------------------------------+ |Type |Mime | +==============+========================================================================================+ |CSV |text/csv | +--------------+----------------------------------------------------------------------------------------+ |DOC |application/vnd.openxmlformats-officedocument.wordprocessingml.document | +--------------+----------------------------------------------------------------------------------------+ |DOCX |application/vnd.openxmlformats-officedocument.wordprocessingml.document | +--------------+----------------------------------------------------------------------------------------+ |JSON |application/json | +--------------+----------------------------------------------------------------------------------------+ |PDF |application/pdf | +--------------+----------------------------------------------------------------------------------------+ |PPT |application/vnd.openxmlformats-officedocument.presentationml.presentation | +--------------+----------------------------------------------------------------------------------------+ |PPTX |application/vnd.openxmlformats-officedocument.presentationml.presentation | +--------------+----------------------------------------------------------------------------------------+ |SRT |text/plain | +--------------+----------------------------------------------------------------------------------------+ |XLS |application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | +--------------+----------------------------------------------------------------------------------------+ |XLSX |application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | +--------------+----------------------------------------------------------------------------------------+ |ZIP |application/zip | +--------------+----------------------------------------------------------------------------------------+ Uploading documents ------------------- Upload a document and send its contents as a part of an HTTP request body. .. code:: POST /api/1.3/documents .. note:: * Multiple files can be sent as part of an HTTP request. * For requests with "multipart/form-data" content type, files should be named with "file". Example with multipart/form-data ******************************** .. code:: POST /api/1.3/documents HTTP/1.1 HOST: x-rmauth: authorization: Basic content-type: multipart/form-data; boundary=----WebKitFormBoundarym59pe8dwmBaESksR content-length: ------WebKitFormBoundarym59pe8dwmBaESksR Content-Disposition: form-data; name="file"; filename="document.pdf" Content-Type: application/pdf ------WebKitFormBoundarym59pe8dwmBaESksR-- Response ******** For a single document: .. code:: json { "shortcode_params": { "site_id": 123456, "original_filename": "document.pdf" }, "file_original_url": "https://roar-assets-auto.rbl.ms/documents/123/document.pdf", "media_html": "document.pdf", "original_filename": "document.pdf", "shortcode_id": "f538698f8aa1739b0e1ef3", "shortcode": "[rebelmouse-document-pdf 123 site_id=123456 original_filename=\"document.pdf\"]", "id": 12345, "filename": "document.pdf" }, For multiple documents: The documents will all use the same schema and will be returned in the form of an array. Editing documents ----------------- Editing a document (in terms of changing file content). Same as uploading, file contents are sent as a part of an HTTP request body. .. code:: PUT /api/1.3/documents/ Response ******** The response here is the same as when document are uploaded. Only one document can be edited per request.