три метода
аутентификация: http basic
curl -v -F app_id=some -F document_id=1234-56789 -F file=@blob.bin
http://user:user@ministore01.some.org/api/document/upload
{
"result":{
"document":{
"id":18,
"app_id":"some",
"document_id":"1234-56789",
"created_at":"2019-11-21T11:41:56.630Z",
"updated_at":"2019-11-21T11:41:56.635Z"
},
"blob":{
"id":17,
"key":"pa3wrpdxfpae4p1sdp3k17swjzle",
"filename":"blob.bin",
"content_type":"application/x-sega-cd-rom",
"metadata":{
"identified":true
},
"byte_size":1048576,
"checksum":"8n4cf3zyKnAK8Aey9abXWQ==",
"created_at":"2019-11-21T11:41:56.633Z"
}
}
}
к примеру, если документ с таким id уже существует
{"result":{"document":null,"reason":"document has already been taken"}}
$ curl -v 'http://user:user@ministore01.some.org/api/document/search?app_id=some&document_id=1234-56789'
{
"result":{
"document":{
"id":18,
"app_id":"some",
"document_id":"1234-56789",
"created_at":"2019-11-21T11:41:56.630Z",
"updated_at":"2019-11-21T11:41:56.635Z"
},
"blob":{
"id":17,
"key":"pa3wrpdxfpae4p1sdp3k17swjzle",
"filename":"blob.bin",
"content_type":"application/x-sega-cd-rom",
"metadata":{
"identified":true
},
"byte_size":1048576,
"checksum":"8n4cf3zyKnAK8Aey9abXWQ==",
"created_at":"2019-11-21T11:41:56.633Z"
},
"url":"http://ministore1.some.org/rails/active_storage/blobs/eyJ...e0/blob.bin"
}
}
{"result":{"document":null,"reason":"not found"}}
curl -v 'http://user:user@ministore01.some.org/api/document/download?app_id=some&document_id=1234-56789'