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/f3641d0ba0f042e8b49de06d5c7921af/documents?acc_token=2ef61fa89e8a451ba4149d2f8e31173b HTTP/1.0
    Authorization: Basic YnJva2VyOg==
    Content-Length: 334
    Content-Type: application/json
    Host: api-sandbox.openprocurement.org
    
    {
      "data": {
        "url": "http://public.docs-sandbox.openprocurement.org/get/33bd696eba8a4877af96fc267df48c21?KeyID=459f8ecf&Signature=3SoLjvN%2Bubc3yUq7E%2F8z%2FT4nhwBCO%2BYejSIqF2ORk3btE1ug052zZDNQQpi4yyd1rj%2FPX09LiTVm%2BoTVYouoCg%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/f3641d0ba0f042e8b49de06d5c7921af/documents/8c4f7355fed4463b98eb429237a2e6a5
    
    {
      "data": {
        "hash": "md5:00000000000000000000000000000000",
        "author": "tender_owner",
        "title": "Notice.pdf",
        "url": "http://public.docs-sandbox.openprocurement.org/get/33bd696eba8a4877af96fc267df48c21?KeyID=459f8ecf&Signature=ddH8OS09K%252BBpHxgERTqBTtRkfEU1q6Lj65I1JeIn%2FlcdEC6e2eOs936ScnDmRUAtryWyyLR75Zt6aaB1%2FLtWBw%253D%253D",
        "format": "application/pdf",
        "documentOf": "tender",
        "datePublished": "2017-07-25T17:36:56.044656+03:00",
        "id": "8c4f7355fed4463b98eb429237a2e6a5",
        "dateModified": "2017-07-25T17:36:56.044677+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/f3641d0ba0f042e8b49de06d5c7921af/documents?acc_token=2ef61fa89e8a451ba4149d2f8e31173b HTTP/1.0
    Authorization: Basic YnJva2VyOg==
    Content-Length: 334
    Content-Type: application/json
    Host: api-sandbox.openprocurement.org
    
    {
      "data": {
        "url": "http://public.docs-sandbox.openprocurement.org/get/33bd696eba8a4877af96fc267df48c21?KeyID=459f8ecf&Signature=3SoLjvN%2Bubc3yUq7E%2F8z%2FT4nhwBCO%2BYejSIqF2ORk3btE1ug052zZDNQQpi4yyd1rj%2FPX09LiTVm%2BoTVYouoCg%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/f3641d0ba0f042e8b49de06d5c7921af/documents/8c4f7355fed4463b98eb429237a2e6a5
    
    {
      "data": {
        "hash": "md5:00000000000000000000000000000000",
        "author": "tender_owner",
        "title": "Notice.pdf",
        "url": "http://public.docs-sandbox.openprocurement.org/get/33bd696eba8a4877af96fc267df48c21?KeyID=459f8ecf&Signature=ddH8OS09K%252BBpHxgERTqBTtRkfEU1q6Lj65I1JeIn%2FlcdEC6e2eOs936ScnDmRUAtryWyyLR75Zt6aaB1%2FLtWBw%253D%253D",
        "format": "application/pdf",
        "documentOf": "tender",
        "datePublished": "2017-07-25T17:36:56.044656+03:00",
        "id": "8c4f7355fed4463b98eb429237a2e6a5",
        "dateModified": "2017-07-25T17:36:56.044677+03:00"
      }
    }