openapi: 3.2.0 info: description: Stanford Digital Repository API version: 1.0.0 title: SDR Files API license: name: Apache 2.0 url: http://www.apache.org/licenses/LICENSE-2.0.html servers: - url: https://sdr-api-{env}.stanford.edu description: Production service variables: env: default: prod - url: https://sdr-api-{env}.stanford.edu description: Staging service variables: env: default: stage security: - bearerAuth: [] tags: - name: files description: upload binary files paths: /v1/direct_uploads: post: tags: - files summary: Creates a new file resource responses: '200': description: OK content: application/json: example: id: 56 key: 3eh3k0x16eysn9ivndmqjo5jdf4d filename: Gemfile.lock content_type: text/html metadata: {} byte_size: 1082 checksum: A72Iwi4DGf80H7WM4VHuUw== created_at: '2020-01-07T23:18:08.818Z' signed_id: eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBQUT09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--8802f5d43bd2c192ef783e02c55481d129a51a72 direct_upload: url: http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhNMlZvTTJzd2VERTJaWGx6YmpscGRtNWtiWEZxYnpWcVpHWTBaQVk2QmtWVU9oRmpiMjUwWlc1MFgzUjVjR1ZKSWc1MFpYaDBMMmgwYld3R093WlVPaE5qYjI1MFpXNTBYMnhsYm1kMGFHa0NPZ1E2RFdOb1pXTnJjM1Z0U1NJZFFUY3lTWGRwTkVSSFpqZ3dTRGRYVFRSV1NIVlZkejA5QmpzR1ZBPT0iLCJleHAiOiIyMDIwLTAxLTA3VDIzOjIzOjA4LjgyNFoiLCJwdXIiOiJibG9iX3Rva2VuIn19--ae7c0227ed5840f30b3293d2f2b6c8109397527a headers: Content-Type: text/html /v1/disk/{encoded_token}: put: tags: - files summary: 'Upload the binary file resource Note that the ''content_type'' of the file posted will be set to ''application/octet-stream'' if not supplied. Additional values in ''content_type'' after a semicolon will be removed (e.g. '';v15'' is removed in ''application/text;v15'') You may post JSON files with ''content_type'' of ''application/x-stanford-json'' to avoid 400 errors if posted JSON file is invalid. The system will automatically change the content type to ''application/json'' after upload. ' responses: '200': description: OK parameters: - name: encoded_token in: path required: true example: eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaDdDVG9JYTJWNVNTSWhhbkk1YlRNeFpuQnJkbmwxZG1zM01qYzFOM042ZURRMWRXYzBOQVk2QmtWVU9oRmpiMjUwWlc1MFgzUjVjR1ZKSWc1MFpYaDBMMmgwYld3R093WlVPaE5qYjI1MFpXNTBYMnhsYm1kMGFHa0Jrem9OWTJobFkydHpkVzFKSWgxemFURXZURE5xVEV0M05GRjVVRGw0UjNaMEsyRlJQVDBHT3daVSIsImV4cCI6IjIwMjAtMDEtMDlUMjE6MzI6NDguNDc1WiIsInB1ciI6ImJsb2JfdG9rZW4ifX0=--da785217f57ab55fe37e8de0a9c26b4d7612c187 schema: type: string components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT