Occupation codes
How to read the list of occupation codes the gateway accepts and what the occupation-code check does with the code of a contract.
On this page
Every contract has the code of the occupation of the employee. Occupation codes follow the Classification of Occupations in Romania (COR), six-digit level. This page shows how to read the list the gateway accepts and what the occupation-code check does with a code.
Read the list
listOccupations returns the occupations the check accepts, in pages. q keeps the occupations whose name contains the text; the names are in Romanian.
curl
curl "$RDC_BASE_URL/reges/v1/occupations?limit=20" \
-H "Authorization: Bearer $RDC_TOKEN" JavaScript
const response = await fetch(`${process.env.RDC_BASE_URL}/reges/v1/occupations?limit=20`, {
method: 'GET',
headers: {
Authorization: `Bearer ${process.env.RDC_TOKEN}`,
},
});
const result = await response.json(); Python
import os
import requests
response = requests.request(
'GET',
f'{os.environ["RDC_BASE_URL"]}/reges/v1/occupations?limit=20',
headers={
'Authorization': f'Bearer {os.environ["RDC_TOKEN"]}',
},
)
result = response.json() PHP
<?php
$curl = curl_init(getenv('RDC_BASE_URL') . '/reges/v1/occupations?limit=20');
curl_setopt_array($curl, [
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('RDC_TOKEN'),
],
]);
$result = json_decode(curl_exec($curl), true);
curl_close($curl); C#
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Get, $"{Environment.GetEnvironmentVariable("RDC_BASE_URL")}/reges/v1/occupations?limit=20");
request.Headers.Authorization = new AuthenticationHeaderValue("Bearer", Environment.GetEnvironmentVariable("RDC_TOKEN"));
var response = await client.SendAsync(request);
var result = await response.Content.ReadAsStringAsync(); {
"items": [
{
"code": "331302",
"name": "Contabil"
},
{
"code": "333304",
"name": "Inspector/referent resurse umane"
},
{
"code": "432101",
"name": "Gestionar depozit"
},
{
"code": "432102",
"name": "Magaziner"
},
{
"code": "522101",
"name": "Vânzător"
},
{
"code": "523003",
"name": "Casier"
},
{
"code": "833201",
"name": "Șofer autocamion/mașină de mare tonaj"
},
{
"code": "332401",
"name": "Agent comercial"
},
{
"code": "933301",
"name": "Încărcător-descărcător"
},
{
"code": "121120",
"name": "Contabil-șef"
},
{
"code": "333101",
"name": "Agent contractări și achiziții (broker mărfuri)"
},
{
"code": "251202",
"name": "Programator"
}
],
"nextCursor": null
} The occupation-code check
The check is blocking: while the code is not in the list, the operation cannot be validated, and validateOperation is refused with blocked_by_checks. It runs on a hire and on a change of terms that changes the occupation. A code is 6 digits; editOperation with the occupation field refuses a value that is not one with invalid_value.
{
"id": "occupation-code",
"severity": "blocking",
"passed": true,
"message": "Occupation code 432102 is in the list of occupations (Magaziner).",
"detail": {
"code": "432102"
}
} The contract returns the code with its name. name is null for a code that is not in the list. See The contract object.
{
"code": "432102",
"name": "Magaziner"
} The codes of the examples
| Code | Name |
|---|---|
331302 | Contabil |
333304 | Inspector/referent resurse umane |
432101 | Gestionar depozit |
432102 | Magaziner |
522101 | Vânzător |
523003 | Casier |
833201 | Șofer autocamion/mașină de mare tonaj |
332401 | Agent comercial |
933301 | Încărcător-descărcător |
121120 | Contabil-șef |
333101 | Agent contractări și achiziții (broker mărfuri) |
251202 | Programator |