Кодна листа по тип
Returns the active entries of one code list.
These are the very values used internally, read for the tenant’s UJP environment. A new entry appearing in a code list is not a breaking change.
Примерот важи само за demo околината.
Request
curl -i -X GET "https://sandbox.api.earhiva.mk/api/integration/v1/codelists/<type>" \
-H "X-Api-Key: <ВАШИОТ КЛУЧ>" \
-H "X-Software-Id: <ИМЕ И ВЕРЗИЈА НА ВАШАТА АПЛИКАЦИЈА>"
Секој повик носи X-Api-Key со клуч што го има опфатот IntegrationApi, и X-Software-Id со името и верзијата на твојот софтвер. Како се бара клуч стои во Автентикација.
Parameters
Сите параметри (3)
| Parameter | In | Type | Presence | Description |
|---|---|---|---|---|
type | path | string | always | The code list to read. In an integration flow you need reject-reasons — the code you send in POST decision comes from there, and it is the only one you enter verbatim. document-statuses is what appears in ujp.state, and is read, never sent. The remaining lists back the mapping eArhiva.mk performs per organisation: you send the codes used in your own system, and they are translated on our side. An unknown type is refused with EARH-2021, whose response names every supported one. |
asOf | query | string | optional | Optional day the validity is judged against, as yyyy-MM-dd. Omitted means today. Use it when you are about to submit a document dated in the past: a submission is checked against the date of the document, so an entry valid today is not necessarily valid then. Each entry also carries validFrom and validTo. |
X-Software-Id | header | string | always | Identifier of the calling software, e.g. SSBFocus/4.2.1. Free text, recorded in the audit trail. Required on every call; missing means EARH-1008. |
Error codes
EARH-1001 · EARH-1002 · EARH-1003 · EARH-1004 · EARH-1005 · EARH-1006 · EARH-1010 · EARH-1011 · EARH-2020 · EARH-2021
Целосниот список шифри, со што значат и што да се направи, е во Каталог на грешки.
Responses
Дел со наслов „ Responses “The requested type and its entries valid on the requested day.
{
"type": "currency",
"items": [
{
"code": "036",
"name": "AUD"
},
{
"code": "124",
"name": "CAD"
}
]
}
Сите полиња во телото (2)
| Field | Type | Presence | Description |
|---|---|---|---|
type | string | always | The requested codelist type, echoed back. |
items | низа од објект | always | Active entries of that codelist for the tenant’s UJP environment. |
EARH-2021 — unknown code list type; the response lists the supported ones. Checked before
the tenant or the lookup service is touched. EARH-2020 — asOf cannot be read as a date.
{
"type": "https://earhiva.mk/errors/EARH-2021",
"title": "Unknown codelist type.",
"status": 400,
"code": "EARH-2021"
}
Сите полиња во телото (6)
| Field | Type | Presence | Description |
|---|---|---|---|
type | string | always | Address of this code in the error catalogue (RFC 7807). |
title | string | always | Short, stable English summary of the error — the same string that appears in your log. |
status | integer · int32 | always | HTTP status code, repeated in the body (RFC 7807). |
detail | string | nullable | What went wrong in this particular call, when there is more to say than the title. Absent when the title already says everything. |
code | string | always | The EARH-xxxx code. This is the contract: match on it, not on the text. |
eventId | string | nullable | Only on EARH-9000. Quote it when reporting the problem — it is the same reference we record in our log, so one number identifies the event on both sides. |
The API key is missing, unknown, expired or revoked — EARH-1001, EARH-1002, EARH-1003. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.
The caller’s address is outside the allowed list, the key does not carry the IntegrationApi scope, the organization’s plan does not include integration access, or the key has been switched off by its owner — EARH-1004, EARH-1005, EARH-1010, EARH-1011. The last two are returned on every call and carry no Retry-After: waiting does not change the state. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.
The traffic limit for this key has been reached — EARH-1006. The response carries Retry-After. The limit is counted per key, and its size comes from the organization’s plan. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.
Unexpected error on our side — EARH-9000. The body carries eventId; quote it when reporting the problem. Телото е стандардното тело на грешка — исто кај сите повици. Што да се направи со секоја шифра стои во Каталог на грешки.