-
Notifications
You must be signed in to change notification settings - Fork 37
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.
- Make sure you have Python 3 installed.
- Run
python3 -m pip install overview-upload
to install overview-upload. You may need to prefix the command withsudo
on Linux or Mac, depending on how Python was set up. - Check the install worked: run
overview-upload
. You should see some text that starts withusage: overview-upload
.
- 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.
- 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.
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.