Working with the API
Authentication
Most actions against the backend require you to be logged in as a user with the appropriate permissions. By sending a request like:
your authentication request will be validated, and a session token
will be returned in the JSON response for your request. To remain
authenticated, provide this token with subsequent requests in the
X-ArchivesSpace-Session
header. For example:
Since not all backend/API end points require authentication, it is best to restrict access to port 8089 to only IP addresses you trust. Your firewall should be used to specify a range of IP addresses that are allowed to call your ArchivesSpace API endpoint. This is commonly called whitelisting or allowlisting.
Example requests using CURL
Send request to authenticate:
This will return a JSON response that includes something like the following:
It’s a good idea to save the session key as an environment variable to use for later requests:
Now you can make requests like this:
CRUD
The ArchivesSpace API provides CRUD-style interactions for a number of different “top-level” record types. Working with records follows a fairly standard pattern:
Performing API requests
Additional documentation is needed for these sections - please consider contributing documentation via a pull request to this repo
GET requests
Resolving associated records
Additional documentation needed
Requests for paginated results
Additional documentation needed
Working with long results sets
Additional documentation needed
Search requests
Additional documentation needed
POST requests
Updating existing records
Additional documentation needed
Creating new records
Additional documentation needed
DELETE requests
Additional documentation needed