Documents Uploading

All of the document uploading API endpoints follow the same set of rules.

Upload document with registration

  1. Register document upload in document service.

  2. Add document in API:

    POST /api/2.3/tenders/f860f9fe94574d729c87f81cea222b46/documents?acc_token=b84904c40e484b2e9be9af92d1cca8ae HTTP/1.0
    Authorization: Basic YnJva2VyOg==
    Content-Length: 324
    Content-Type: application/json
    Host: api-sandbox.openprocurement.org
    
    {
      "data": {
        "url": "http://public.docs-sandbox.openprocurement.org/get/789735fb78a349da9f22a4bb3cb6b32f?KeyID=661750a8&Signature=tfUwl51t5wGSphUKaNLRqN7AbdYACSV10Rk1QcIO1J%2FlfS1sPxmVkRdM8f2WvWT9Qg4XanzZIxhOGEPhCa86Aw%3D%3D",
        "title": "Notice.pdf",
        "hash": "md5:00000000000000000000000000000000",
        "format": "application/pdf"
      }
    }
    
    
    201 Created
    Content-Type: application/json; charset=UTF-8
    Location: http://api-sandbox.openprocurement.org/api/2.3/tenders/f860f9fe94574d729c87f81cea222b46/documents/0d34d2cd91f14650af325f081014e682
    
    {
      "data": {
        "hash": "md5:00000000000000000000000000000000",
        "author": "tender_owner",
        "title": "Notice.pdf",
        "url": "http://public.docs-sandbox.openprocurement.org/get/789735fb78a349da9f22a4bb3cb6b32f?KeyID=661750a8&Signature=b1y%252BWqNZyRMzQ08R49e8ajjS5Io1JCpsHXdiB7AyfjAYwJLqRtrU%2Fdnj3oSEhiAgw87czAsRdlpWiQi5k23xDA%253D%253D",
        "format": "application/pdf",
        "documentOf": "tender",
        "datePublished": "2017-06-24T18:05:46.316547+03:00",
        "id": "0d34d2cd91f14650af325f081014e682",
        "dateModified": "2017-06-24T18:05:46.316590+03:00"
      }
    }
    
  3. Upload document in document service.

Upload document w/o registration

  1. Register document upload in document service.

  2. Add document in API:

    POST /api/2.3/tenders/f860f9fe94574d729c87f81cea222b46/documents?acc_token=b84904c40e484b2e9be9af92d1cca8ae HTTP/1.0
    Authorization: Basic YnJva2VyOg==
    Content-Length: 324
    Content-Type: application/json
    Host: api-sandbox.openprocurement.org
    
    {
      "data": {
        "url": "http://public.docs-sandbox.openprocurement.org/get/789735fb78a349da9f22a4bb3cb6b32f?KeyID=661750a8&Signature=tfUwl51t5wGSphUKaNLRqN7AbdYACSV10Rk1QcIO1J%2FlfS1sPxmVkRdM8f2WvWT9Qg4XanzZIxhOGEPhCa86Aw%3D%3D",
        "title": "Notice.pdf",
        "hash": "md5:00000000000000000000000000000000",
        "format": "application/pdf"
      }
    }
    
    
    201 Created
    Content-Type: application/json; charset=UTF-8
    Location: http://api-sandbox.openprocurement.org/api/2.3/tenders/f860f9fe94574d729c87f81cea222b46/documents/0d34d2cd91f14650af325f081014e682
    
    {
      "data": {
        "hash": "md5:00000000000000000000000000000000",
        "author": "tender_owner",
        "title": "Notice.pdf",
        "url": "http://public.docs-sandbox.openprocurement.org/get/789735fb78a349da9f22a4bb3cb6b32f?KeyID=661750a8&Signature=b1y%252BWqNZyRMzQ08R49e8ajjS5Io1JCpsHXdiB7AyfjAYwJLqRtrU%2Fdnj3oSEhiAgw87czAsRdlpWiQi5k23xDA%253D%253D",
        "format": "application/pdf",
        "documentOf": "tender",
        "datePublished": "2017-06-24T18:05:46.316547+03:00",
        "id": "0d34d2cd91f14650af325f081014e682",
        "dateModified": "2017-06-24T18:05:46.316590+03:00"
      }
    }