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/b74c14bbee6f44a9a0c8408c13a4c1a8/documents?acc_token=6241dc3adcf04c33b4f86f08e8e6e591 HTTP/1.0
    Authorization: Basic YnJva2VyOg==
    Content-Length: 332
    Content-Type: application/json
    Host: api-sandbox.openprocurement.org
    
    {
      "data": {
        "url": "http://public.docs-sandbox.openprocurement.org/get/4ff4633a89034136ab1ed3b77a7e9fc7?KeyID=ef5aa287&Signature=1bqDEL%2F9xm1EiQmvvfdwA2hCT5BkgrBUEGn4FWiN5bsPBptky6%2FmjK%2FkOC403RLLKGQSOUa41yd9p%2FEH%2FQrrCg%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/b74c14bbee6f44a9a0c8408c13a4c1a8/documents/73edadd66f2a4178917993081ea1be10
    
    {
      "data": {
        "hash": "md5:00000000000000000000000000000000",
        "title": "Notice.pdf",
        "url": "http://public.docs-sandbox.openprocurement.org/get/4ff4633a89034136ab1ed3b77a7e9fc7?KeyID=ef5aa287&Signature=z3ShJ3uzAcIFGzln4nWGwSnz1SwQI9HS7HRzIpPgeLF5iOUMVjJr0WSRbIU1etZkTgrRq36rIFAmCHZHJRpAATQAAABmAAAAZgAAADQAAAA2AAAAMwAAADMAAABhAAAA",
        "format": "application/pdf",
        "documentOf": "tender",
        "datePublished": "2016-07-21T17:18:05.687403+03:00",
        "id": "73edadd66f2a4178917993081ea1be10",
        "dateModified": "2016-07-21T17:18:05.687435+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/b74c14bbee6f44a9a0c8408c13a4c1a8/documents?acc_token=6241dc3adcf04c33b4f86f08e8e6e591 HTTP/1.0
    Authorization: Basic YnJva2VyOg==
    Content-Length: 332
    Content-Type: application/json
    Host: api-sandbox.openprocurement.org
    
    {
      "data": {
        "url": "http://public.docs-sandbox.openprocurement.org/get/4ff4633a89034136ab1ed3b77a7e9fc7?KeyID=ef5aa287&Signature=1bqDEL%2F9xm1EiQmvvfdwA2hCT5BkgrBUEGn4FWiN5bsPBptky6%2FmjK%2FkOC403RLLKGQSOUa41yd9p%2FEH%2FQrrCg%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/b74c14bbee6f44a9a0c8408c13a4c1a8/documents/73edadd66f2a4178917993081ea1be10
    
    {
      "data": {
        "hash": "md5:00000000000000000000000000000000",
        "title": "Notice.pdf",
        "url": "http://public.docs-sandbox.openprocurement.org/get/4ff4633a89034136ab1ed3b77a7e9fc7?KeyID=ef5aa287&Signature=z3ShJ3uzAcIFGzln4nWGwSnz1SwQI9HS7HRzIpPgeLF5iOUMVjJr0WSRbIU1etZkTgrRq36rIFAmCHZHJRpAATQAAABmAAAAZgAAADQAAAA2AAAAMwAAADMAAABhAAAA",
        "format": "application/pdf",
        "documentOf": "tender",
        "datePublished": "2016-07-21T17:18:05.687403+03:00",
        "id": "73edadd66f2a4178917993081ea1be10",
        "dateModified": "2016-07-21T17:18:05.687435+03:00"
      }
    }