Tutorial¶
Upload document with registration¶
Register document upload:¶
POST /register HTTP/1.0
Authorization: Basic YnJva2VyOmJyb2tlcg==
Content-Length: 43
Content-Type: application/x-www-form-urlencoded
Host: docs-sandbox.openprocurement.org
hash=md5%3A9a0364b9e99bb480dd25e1f0284c8555
201 Created
Content-Type: application/json; charset=UTF-8
Location: http://docs-sandbox.openprocurement.org/upload/a6754e7c32a542fcb9a56ca598064be3?KeyID=d06070b8&Signature=IMlA7SU1lQXGm7qGFBJQD7QEWv6K9ms9%2FcllUsQbbBLhWf48O5RVluaToch3Eopd%2FMoxXCozpL0gN6J65yeVCg%253D%253D
{
"upload_url": "http://docs-sandbox.openprocurement.org/upload/a6754e7c32a542fcb9a56ca598064be3?KeyID=d06070b8&Signature=IMlA7SU1lQXGm7qGFBJQD7QEWv6K9ms9%2FcllUsQbbBLhWf48O5RVluaToch3Eopd%2FMoxXCozpL0gN6J65yeVCg%253D%253D",
"data": {
"url": "http://docs-sandbox.openprocurement.org/get/a6754e7c32a542fcb9a56ca598064be3?KeyID=d06070b8&Signature=sKX3ICZh%252B61vhvLGgfrs00jdo63IfIcdB247Z40FDCxxY4eG6h2v1fA0FNsTlbRiEQSzFar0DbenFvp6M7vbDg%253D%253D",
"hash": "md5:9a0364b9e99bb480dd25e1f0284c8555"
}
}
or:
POST /register HTTP/1.0
Authorization: Basic YnJva2VyOmJyb2tlcg==
Content-Length: 58
Content-Type: application/json
Host: docs-sandbox.openprocurement.org
{
"data": {
"hash": "md5:9a0364b9e99bb480dd25e1f0284c8555"
}
}
201 Created
Content-Type: application/json; charset=UTF-8
Location: http://docs-sandbox.openprocurement.org/upload/389684cc28c242b79c97c56be5142e25?KeyID=d06070b8&Signature=%252Bgia5OJqJwJgOjGadnGPmL0%252BPYNs7CXokIz2Eb%252B1ujKrZu7vrIBsK1hYzzj5Az7GPkr12l5%2FT17zFLExNU6TAw%253D%253D
{
"upload_url": "http://docs-sandbox.openprocurement.org/upload/389684cc28c242b79c97c56be5142e25?KeyID=d06070b8&Signature=%252Bgia5OJqJwJgOjGadnGPmL0%252BPYNs7CXokIz2Eb%252B1ujKrZu7vrIBsK1hYzzj5Az7GPkr12l5%2FT17zFLExNU6TAw%253D%253D",
"data": {
"url": "http://docs-sandbox.openprocurement.org/get/389684cc28c242b79c97c56be5142e25?KeyID=d06070b8&Signature=Ky2HmhmupginXHtbTZO5kjqqgSZhe96u5FEvwIyl%252Bg4lNqFx7ykJjSoUoek%2FyuK3l3uyiBOaSrwWdT3RQF1%2FBA%253D%253D",
"hash": "md5:9a0364b9e99bb480dd25e1f0284c8555"
}
}
Upload document:¶
POST /upload/a6754e7c32a542fcb9a56ca598064be3?KeyID=d06070b8&Signature=IMlA7SU1lQXGm7qGFBJQD7QEWv6K9ms9%2FcllUsQbbBLhWf48O5RVluaToch3Eopd%2FMoxXCozpL0gN6J65yeVCg%253D%253D HTTP/1.0
Authorization: Basic YnJva2VyOmJyb2tlcg==
Content-Length: 179
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy572732436472$
Host: docs-sandbox.openprocurement.org
------------a_BoUnDaRy572732436472$
Content-Disposition: form-data; name="file"; filename="file.txt"
Content-Type: text/plain
content
------------a_BoUnDaRy572732436472$--
200 OK
Content-Type: application/json; charset=UTF-8
{
"get_url": "http://docs-sandbox.openprocurement.org/get/a6754e7c32a542fcb9a56ca598064be3?Expires=1469462161&KeyID=d06070b8&Signature=mG1VowjmkivEAhiSrCYbcaKgbsiO8nOWau4my%252BVZHZsQrSZZXG3wPG6zVkUuTc2TLKJhd9wP%2F3S3jcZ5Jd7eBA%253D%253D",
"data": {
"url": "http://docs-sandbox.openprocurement.org/get/a6754e7c32a542fcb9a56ca598064be3?KeyID=d06070b8&Signature=qwiE1zcGeR7bPSTawNedZ0yUrx0OeW4mL1HbctBRHDYSxGI9Zom8gR0JUZFwmOlpxkpps0AJhnJ7j%2FgNFqQeBA%253D%253D",
"format": "text/plain",
"hash": "md5:9a0364b9e99bb480dd25e1f0284c8555",
"title": "file.txt"
}
}
Upload document w/o registration¶
POST /upload HTTP/1.0
Authorization: Basic YnJva2VyOmJyb2tlcg==
Content-Length: 179
Content-Type: multipart/form-data; boundary=----------a_BoUnDaRy268861013861$
Host: docs-sandbox.openprocurement.org
------------a_BoUnDaRy268861013861$
Content-Disposition: form-data; name="file"; filename="file.txt"
Content-Type: text/plain
content
------------a_BoUnDaRy268861013861$--
200 OK
Content-Type: application/json; charset=UTF-8
Location: http://docs-sandbox.openprocurement.org/get/8ccbfde0c6804143b119d9168452cb6f?Expires=1469462161&KeyID=d06070b8&Signature=dwZxxhFHS8BdfOrxSydmaOfLuadAsCrOF2w%2FVA%252Bfik3lViqozqytPhZGVzpP0NZ1RXFcSv0EgVTx0dZhLk9aBw%253D%253D
{
"get_url": "http://docs-sandbox.openprocurement.org/get/8ccbfde0c6804143b119d9168452cb6f?Expires=1469462161&KeyID=d06070b8&Signature=dwZxxhFHS8BdfOrxSydmaOfLuadAsCrOF2w%2FVA%252Bfik3lViqozqytPhZGVzpP0NZ1RXFcSv0EgVTx0dZhLk9aBw%253D%253D",
"data": {
"url": "http://docs-sandbox.openprocurement.org/get/8ccbfde0c6804143b119d9168452cb6f?KeyID=d06070b8&Signature=SNIIGIyE9QL2SBroR40gm%252BAHIAZyTOKJCrUxw8m7Jyy77%2FiVonIGDn2jLEE05lM6Nsmu0tDCfII%2Fa98KpntXDw%253D%253D",
"format": "text/plain",
"hash": "md5:9a0364b9e99bb480dd25e1f0284c8555",
"title": "file.txt"
}
}
Get document¶
GET /get/a6754e7c32a542fcb9a56ca598064be3?Expires=1469462161&KeyID=d06070b8&Signature=mG1VowjmkivEAhiSrCYbcaKgbsiO8nOWau4my%252BVZHZsQrSZZXG3wPG6zVkUuTc2TLKJhd9wP%2F3S3jcZ5Jd7eBA%253D%253D HTTP/1.0
Host: docs-sandbox.openprocurement.org
200 OK
Content-Disposition: attachment; filename=file.txt
Content-Type: text/plain; charset=UTF-8