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:
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:
- acc_token URL query string parameter
- X-Access-Token HTTP request header
- 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.5/assets/863366f04c97422191da348f0776797d?acc_token=1ea3dbc940594a65a75589286f7afad7 HTTP/1.0
Authorization: Basic YnJva2VyOg==
Content-Length: 347
Content-Type: application/json
Host: lb.api-sandbox.registry.ea.openprocurement.net
DATA:
{
"data": {
"description": "Земельні ділянки із великими покладами благородних металів"
}
}
Response: 200 OK
Content-Type: application/json
X-Content-Type-Options: nosniff
{
"data": {
"status": "pending",
"assetType": "bounce",
"rectificationPeriod": {
"startDate": "2019-02-01T11:03:56.081694+02:00"
},
"documents": [
{
"title": "Інформація про оприлюднення інформаційного повідомлення",
"url": "https://prozorro.sale/info/ssp_details",
"documentOf": "asset",
"datePublished": "2019-02-01T11:03:56.017442+02:00",
"documentType": "informationDetails",
"dateModified": "2019-02-01T11:03:56.017466+02:00",
"id": "bd5b68af29824668bded2ad5e9d1a469"
}
],
"description": "Земельні ділянки із великими покладами благородних металів",
"title": "Земля для космодрому",
"assetID": "UA-AR-DGF-2019-02-01-000001",
"items": [
{
"registrationDetails": {
"status": "unknown"
},
"description": "футляри до державних нагород",
"classification": {
"scheme": "CAV-PS",
"description": "Description",
"id": "06121000-6"
},
"additionalClassifications": [
{
"scheme": "UA-EDR",
"description": "папір і картон гофровані, паперова й картонна тара",
"id": "17.21.1"
}
],
"address": {
"countryName": "Ukraine"
},
"id": "3d09b283ac1742ac8814ba8bdab16c00",
"unit": {
"code": "code"
},
"quantity": 5.0001
},
{
"registrationDetails": {
"status": "unknown"
},
"description": "футляри до державних нагород",
"classification": {
"scheme": "CAV-PS",
"description": "Description",
"id": "06121000-6"
},
"additionalClassifications": [
{
"scheme": "UA-EDR",
"description": "папір і картон гофровані, паперова й картонна тара",
"id": "17.21.1"
}
],
"address": {
"countryName": "Ukraine"
},
"id": "d4b3fe3628df4a21ab49b24d5ffd4dca",
"unit": {
"code": "code"
},
"quantity": 5.0001
}
],
"dateModified": "2019-02-01T11:03:56.328853+02:00",
"owner": "broker",
"date": "2019-02-01T11:03:56.081884+02:00",
"decisions": [
{
"decisionDate": "2019-02-01T11:03:55.184232+02:00",
"decisionID": "1111-4",
"id": "a2799e7b35574c1d8854092b95e77fe6",
"decisionOf": "asset"
}
],
"id": "863366f04c97422191da348f0776797d",
"assetCustodian": {
"contactPoint": {
"name": "Державне управління справами",
"telephone": "0440000000"
},
"identifier": {
"scheme": "UA-EDR",
"id": "00037256"
},
"name": "Державне управління справами",
"address": {
"countryName": "Україна"
},
"additionalContactPoints": [
{
"name": "name",
"email": "some@mail.com"
}
]
}
}
}