Skip to content

Uploading documents from the command line

Jonathan Stray edited this page Apr 12, 2018 · 2 revisions

Here's a walkthrough for using overview-upload to maintain a document set through shell scripts.

1. Install overview-upload

  1. Make sure you have Python 3 installed.
  2. Run python3 -m pip install overview-upload to install overview-upload. You may need to prefix the command with sudo on Linux or Mac, depending on how Python was set up.
  3. Check the install worked: run overview-upload. You should see some text that starts with usage: overview-upload.

2. Create a document set via overview-upload

  1. Get an API token: browse to https://www.overviewdocs.com/api-tokens, type "overview-upload", click "Generate token", and copy the code. We'll call it GLOBAL_API_TOKEN here.
  2. Run this command:
overview-create-document-set \
  --server https://www.overviewdocs.com \
  --api-token GLOBAL_API_TOKEN \
  "Hello, world!"

You can add metadata fields by adding a parameter like --metadata-schema-field-names="Date,Author" to the command. You can also add them later.

You'll see output like this:

POST https://www.overviewdocs.com/api/v1/document-sets
Created document set "Hello, world!"
Metadata fields:
Document set ID: 12345
View at: https://www.overviewdocs.com/documentsets/12345
Add documents with API token: 41twgivsgfwc3m0jh8yx5aa0a

Browse to the View at URL to see your new, empty document set.

Store that API token somewhere, too. We'll call it DOCUMENT_SET_API_TOKEN here.

3. Upload a directory full of files the new document set

Let's say you want to upload all the files in my-folder to Overview. You can do it using overview-upload:

overview-upload \
  --server https://www.overviewdocs.com \
  --token DOCUMENT_SET_API_TOKEN \
  my-folder

Browse to the View at URL again, and you'll see all the files you uploaded.

You can also set metadata on the files as you upload them, by creating a CSV that has document references and plus metadata. See these instructions.

Clone this wiki locally