Skip to content

Latest commit

 

History

History
41 lines (27 loc) · 1.96 KB

File metadata and controls

41 lines (27 loc) · 1.96 KB

Importing content

Importing from MSWord or Evernote

You can import Microsoft Word or OpenOffice files as RSpace documents. This is the same functionality as the Create->from Word feature in the web application.

The API calls are similar to those for uploading files. You'll need a Word/Office file, and optionally a folder ID that you want to import into:

curl -X POST "$RSPACE_URL/api/v1/import/word" -H "accept: application/json" \
-H "apiKey: $API_KEY" -H "content-type: multipart/form-data" \
-F "file=@<WORD_FILE>.doc;type=application/msword"

If you don't specify a folder ID, the RSpace document will be created in the 'Api Inbox' folder.

Evernote .enex files can be imported using a similar mechanism, e.g.:

curl -X POST "$RSPACE_URL/api/v1/import/evernote" -H "accept: application/json" \
-H "apiKey: $API_KEY" -H "content-type: multipart/form-data" \
-F "file=@<EVERNOTE_FILE>.enex;type=application/xml"

If successful, a new folder will be returned, containing the newly imported notes. An Evernote 'Note' will be converted into an RSpace plain text document.

Importing files from Dropbox, OneDrive or Box

Since 1.69.34, RSpace supports programmatic creation of links to external files using the API. This is useful if you have many files on one of these external services, and you want to reference them from RSpace.

First of all you will need to use the file-service's API to download information about the files: an ID, the file name and a weblink that the RSpace user will click on to view the file from within RSpace.

Then you can include an array of externalFiles in the field definition and include it in a POST or PUT, e.g.

curl -X POST "$RSPACE_URL/api/v1/documents" -H "accept: application/json" \
-H "apiKey: $API_KEY" -d '@examples/example1Drive.json'

Insert placeholders in the text where you want the links to appear, using syntax like <externalFileLink=N> where N is the 0-based index into the array of externalFiles.