Resources

This page contains all relevant resources used during development

Example BagIts

BagIt Zip files

Since the upload endpoint requires a BagIt file in zip format here are some pre-made zip files to test the upload endpoint.

#1 Valid BagIt For Top Level Container w/Folder

#2 Valid BagIt For Top Level Container w/File

#3 Valid BagIt For Existing Container w/Single File

#4 Valid BagIt For Existing Container w/Folders & Files

#5 Invalid BagIt - Bad Manifest

#6 Invalid BagIt - Missing File

#7 Invalid BagIt - Unknown File

Example Workflow

The following are instructions on how the BagIt files above can be used to test the Upload endpoint:

  1. Make a POST to https://presqt-prod.crc.nd.edu/api_v1/targets/osf/resources/ with BagIt #2 to see a new top level container created.

  2. Get the id of the new container and make a POST to https://presqt-prod.crc.nd.edu/api_v1/targets/osf/resources/{resource_id}/ with BagIt #3 and with the ‘presqt-file-duplicate-action’ set to ‘ignore’ to see that the duplicate file is found and it’s contents are different but the file is updated.

  3. Make the same request as 2 but set the header ‘presqt-file-duplicate-action’ to ‘update’ to see the file updated.

  4. With the same container id make a POST request to https://presqt-prod.crc.nd.edu/api_v1/targets/osf/resources/{resource_id}/ with BagIt #4 to see new files and folders added to the top level container.

  5. A POST request with BagIts 5-7 should return an error with nothing being uploaded.