Authentication
All requests to the Data Upload API require authentication. For programmatic and automated workflows, prefer using a scoped API key created in the Auth Service UI at: https://www.dev.immport.org/auth/api/keys. Include the returned api_key value in the Authorization header as a Bearer token.
Using API keys
Set a scoped API key in your environment and use it in requests. Example:
Shell Script - Retrieve Templates
#!/bin/bash
# Create a scoped API key at: https://www.dev.immport.org/auth/api/keys
export IMMPORT_API_KEY="REPLACE_WITH_API_KEY"
curl -k -H "Authorization: Bearer ${IMMPORT_API_KEY}" https://immport-upload.niaid.nih.gov:8443/data/upload/documentation/templates/REPLACE_WITH_WORKSPACE_ID
Results
templates.zip
The above shell script can be copied to a .sh file (e.g. documentationGeneration.sh) and executed at the command prompt. Replace REPLACE_WITH_WORKSPACE_ID and REPLACE_WITH_API_KEY with appropriate values.