|
| 1 | +# Working with the ArchivesSpace API |
| 2 | + |
| 3 | +## Authentication |
| 4 | + |
| 5 | +Most actions against the backend require you to be logged in as a user |
| 6 | +with the appropriate permissions. By sending a request like: |
| 7 | + |
| 8 | + POST /users/admin/login?password=login |
| 9 | + |
| 10 | +your authentication request will be validated, and a session token |
| 11 | +will be returned in the JSON response for your request. To remain |
| 12 | +authenticated, provide this token with subsequent requests in the |
| 13 | +`X-ArchivesSpace-Session` header. For example: |
| 14 | + |
| 15 | + X-ArchivesSpace-Session: 8e921ac9bbe9a4a947eee8a7c5fa8b4c81c51729935860c1adfed60a5e4202cb |
| 16 | + |
| 17 | + |
| 18 | +## CRUD |
| 19 | + |
| 20 | +The ArchivesSpace API provides CRUD-style interactions for a number of |
| 21 | +different "top-level" record types. Working with records follows a |
| 22 | +fairly standard pattern: |
| 23 | + |
| 24 | + # Get a paginated list of accessions from repository '123' |
| 25 | + GET /repositories/123/accessions?page=1 |
| 26 | + |
| 27 | + # Create a new accession, returning the ID of the new record |
| 28 | + POST /repositories/123/accessions |
| 29 | + {... a JSON document satisfying JSONModel(:accession) here ...} |
| 30 | + |
| 31 | + # Get a single accession (returned as a JSONModel(:accession) instance) using the ID returned by the previous request |
| 32 | + GET /repositories/123/accessions/456 |
| 33 | + |
| 34 | + # Update an existing accession |
| 35 | + POST /repositories/123/accessions/456 |
| 36 | + {... a JSON document satisfying JSONModel(:accession) here ...} |
| 37 | + |
| 38 | + |
| 39 | +## Detailed documentation |
| 40 | + |
| 41 | +* [GET requests (retrieving records)](./get_requests.md) |
| 42 | +* [POST requests (creating and updating records)](./post_requests./md) |
| 43 | +* [DELETE requests](./delete_requests) |
| 44 | +* [API reference](http://archivesspace.github.io/archivesspace/api/) - Includes a complete list of available endpoints and guidance for their use |
0 commit comments