Authentication

Some of the API requests (especially the ones that are read-only GET requests) do not require any authenication. The other ones, that modify data into the database, require broker authentication via API key. Additionally, owner tokens are issued to facilitate multiple actor roles upon object creation.

API keys

API key is username to use with Basic Authenication scheme.

Owner tokens

Getting token

The token is issued when object is created in the database:

POST /api/2.3/tenders?opt_pretty=1 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 4152
Content-Type: application/json
Host: api-sandbox.openprocurement.org

{
  "data": {
    "features": [
      {
        "code": "OCDS-123454-AIR-INTAKE",
        "description": "Ефективна потужність всмоктування пилососа, в ватах (аероватах)",
        "title": "Потужність всмоктування",
        "enum": [
          {
            "value": 0.1,
            "title": "До 1000 Вт"
          },
          {
            "value": 0.15,
            "title": "Більше 1000 Вт"
          }
        ],
        "title_en": "Air Intake",
        "relatedItem": "8eca503285e84092b5f290acb9021b4b",
        "featureOf": "item"
      },
      {
        "code": "OCDS-123454-YEARS",
        "description": "Кількість років, які організація учасник працює на ринку",
        "title": "Років на ринку",
        "enum": [
          {
            "value": 0.05,
            "title": "До 3 років"
          },
          {
            "value": 0.1,
            "title": "Більше 3 років, менше 5 років"
          },
          {
            "value": 0.15,
            "title": "Більше 5 років"
          }
        ],
        "title_en": "Years trading",
        "featureOf": "tenderer"
      }
    ],
    "title": "футляри до державних нагород",
    "minimalStep": {
      "currency": "UAH",
      "amount": 35
    },
    "enquiryPeriod": {
      "endDate": "2016-06-17T15:29:31.512778"
    },
    "title_en": "Cases with state awards",
    "value": {
      "currency": "UAH",
      "amount": 500
    },
    "mode": "test",
    "procurementMethodType": "belowThreshold",
    "procuringEntity": {
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "0440000000"
      },
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "name": "Державне управління справами",
      "kind": "general",
      "address": {
        "countryName": "Україна",
        "postalCode": "01220",
        "region": "м. Київ",
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "locality": "м. Київ"
      }
    },
    "title_ru": "футляры к государственным наградам",
    "items": [
      {
        "description": "футляри до державних нагород",
        "classification": {
          "scheme": "CPV",
          "id": "44617100-9",
          "description": "Cartons"
        },
        "description_en": "Cases with state awards",
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "description_ru": "футляры к государственным наградам",
        "id": "8eca503285e84092b5f290acb9021b4b",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "tenderPeriod": {
      "endDate": "2016-06-24T15:29:31.512778"
    }
  }
}


201 Created
Content-Type: application/json; charset=UTF-8
Location: http://api-sandbox.openprocurement.org/api/2.3/tenders/84d69ce1f311425c92a7be4053d877b8

{
  "access": {
    "token": "7a30ee57d5c64c9b8be04e9a88083a28"
  },
  "data": {
    "procurementMethod": "open",
    "status": "active.enquiries",
    "tenderID": "UA-2016-06-10-000002",
    "tenderPeriod": {
      "startDate": "2016-06-17T15:29:31.512778+03:00",
      "endDate": "2016-06-24T15:29:31.512778+03:00"
    },
    "title": "[ТЕСТУВАННЯ] футляри до державних нагород",
    "minimalStep": {
      "currency": "UAH",
      "amount": 35.0,
      "valueAddedTaxIncluded": true
    },
    "items": [
      {
        "description": "футляри до державних нагород",
        "classification": {
          "scheme": "CPV",
          "description": "Cartons",
          "id": "44617100-9"
        },
        "description_en": "Cases with state awards",
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "description_ru": "футляры к государственным наградам",
        "id": "8eca503285e84092b5f290acb9021b4b",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "procurementMethodType": "belowThreshold",
    "value": {
      "currency": "UAH",
      "amount": 500.0,
      "valueAddedTaxIncluded": true
    },
    "submissionMethod": "electronicAuction",
    "awardCriteria": "lowestCost",
    "next_check": "2016-06-17T15:29:31.512778+03:00",
    "procuringEntity": {
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "0440000000"
      },
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "name": "Державне управління справами",
      "kind": "general",
      "address": {
        "postalCode": "01220",
        "countryName": "Україна",
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "region": "м. Київ",
        "locality": "м. Київ"
      }
    },
    "title_ru": "[ТЕСТИРОВАНИЕ] футляры к государственным наградам",
    "enquiryPeriod": {
      "startDate": "2016-06-10T15:29:48.908243+03:00",
      "endDate": "2016-06-17T15:29:31.512778+03:00"
    },
    "owner": "broker",
    "dateModified": "2016-06-10T15:29:48.915363+03:00",
    "mode": "test",
    "title_en": "[TESTING] Cases with state awards",
    "id": "84d69ce1f311425c92a7be4053d877b8",
    "features": [
      {
        "code": "OCDS-123454-AIR-INTAKE",
        "description": "Ефективна потужність всмоктування пилососа, в ватах (аероватах)",
        "title": "Потужність всмоктування",
        "enum": [
          {
            "value": 0.1,
            "title": "До 1000 Вт"
          },
          {
            "value": 0.15,
            "title": "Більше 1000 Вт"
          }
        ],
        "title_en": "Air Intake",
        "relatedItem": "8eca503285e84092b5f290acb9021b4b",
        "featureOf": "item"
      },
      {
        "code": "OCDS-123454-YEARS",
        "description": "Кількість років, які організація учасник працює на ринку",
        "title": "Років на ринку",
        "enum": [
          {
            "value": 0.05,
            "title": "До 3 років"
          },
          {
            "value": 0.1,
            "title": "Більше 3 років, менше 5 років"
          },
          {
            "value": 0.15,
            "title": "Більше 5 років"
          }
        ],
        "title_en": "Years trading",
        "featureOf": "tenderer"
      }
    ]
  }
}

You can see the access with token in response. Its value can be used to modify objects further under “Owner role”.

Using token

You can pass access token in the following ways:

  1. acc_token URL query string parameter
  2. X-Access-Token HTTP request header
  3. access.token in the body of POST/PUT/PATCH request

See the example of the action with token passed as URL query string:

PATCH /api/2.3/tenders/a4f89b85bdc041f080c73ca5b06ee953?acc_token=be391cdea4bf4d04b9794dc15d5f4b41 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 75
Content-Type: application/json
Host: api-sandbox.openprocurement.org

{
  "data": {
    "tenderPeriod": {
      "endDate": "2016-06-25T15:29:59.225162+03:00"
    }
  }
}


200 OK
Content-Type: application/json; charset=UTF-8

{
  "data": {
    "procurementMethod": "open",
    "status": "active.enquiries",
    "tenderID": "UA-2016-06-10-000001",
    "tenderPeriod": {
      "startDate": "2016-06-17T15:29:31.511759+03:00",
      "endDate": "2016-06-25T15:29:59.225162+03:00"
    },
    "title": "футляри до державних нагород",
    "minimalStep": {
      "currency": "UAH",
      "amount": 35.0,
      "valueAddedTaxIncluded": true
    },
    "items": [
      {
        "description": "футляри до державних нагород",
        "classification": {
          "scheme": "CPV",
          "description": "Cartons",
          "id": "44617100-9"
        },
        "additionalClassifications": [
          {
            "scheme": "ДКПП",
            "id": "17.21.1",
            "description": "папір і картон гофровані, паперова й картонна тара"
          }
        ],
        "deliveryAddress": {
          "postalCode": "79000",
          "countryName": "Україна",
          "streetAddress": "вул. Банкова 1",
          "region": "м. Київ",
          "locality": "м. Київ"
        },
        "deliveryDate": {
          "startDate": "2016-06-12T15:29:31.511759+03:00",
          "endDate": "2016-06-15T15:29:31.511759+03:00"
        },
        "id": "bc8a07adf2df4c98aa22e8d598eb06d3",
        "unit": {
          "code": "44617100-9",
          "name": "item"
        },
        "quantity": 5
      }
    ],
    "procurementMethodType": "belowThreshold",
    "value": {
      "currency": "UAH",
      "amount": 500.0,
      "valueAddedTaxIncluded": true
    },
    "submissionMethod": "electronicAuction",
    "next_check": "2016-06-17T15:29:31.511759+03:00",
    "procuringEntity": {
      "contactPoint": {
        "name": "Державне управління справами",
        "telephone": "0440000000"
      },
      "identifier": {
        "scheme": "UA-EDR",
        "id": "00037256",
        "uri": "http://www.dus.gov.ua/"
      },
      "name": "Державне управління справами",
      "kind": "general",
      "address": {
        "postalCode": "01220",
        "countryName": "Україна",
        "streetAddress": "вул. Банкова, 11, корпус 1",
        "region": "м. Київ",
        "locality": "м. Київ"
      }
    },
    "enquiryPeriod": {
      "startDate": "2016-06-10T15:29:48.639408+03:00",
      "endDate": "2016-06-17T15:29:31.511759+03:00"
    },
    "owner": "broker",
    "dateModified": "2016-06-10T15:29:49.285172+03:00",
    "id": "a4f89b85bdc041f080c73ca5b06ee953",
    "awardCriteria": "lowestCost"
  }
}