API reference

Users and catalogs

The reference values needed to write the rest of the contract: user and country ids.

Countries

GETapi.niucore.com/api/v1/catalog/countries

Scope: profile:read

Active countries, for the profile's country_id selector.

Note

Not paginated: about two hundred rows that barely change. meta carries only request_id.

Returns

idinteger

The country_id value.

codestring

ISO code.

namestring

Country name.

currencystring

The country's currency.

curl -sS -X GET 'https://api.niucore.com/api/v1/catalog/countries' \
  -H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN"
Response
{
  "status": "success",
  "message": "Operación exitosa",
  "message_code": "api_v1_ok",
  "data": [
    {
      "id": 11,
      "code": "AR",
      "name": "Argentina",
      "currency": "ARS"
    },
    {
      "id": 32,
      "code": "CL",
      "name": "Chile",
      "currency": "CLP"
    }
  ],
  "meta": {
    "request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77"
  }
}

Company users

GETapi.niucore.com/api/v1/users

Scope: users:read

The company's users, to build shared_user_ids when sharing a skill.

Read-only, and deliberately sparse

It returns just enough to populate a picker. It does not return role, phone, document or licensing data: that is people administration, done in the application and not with a machine credential. Users cannot be created, edited or deleted through the API either.

Scope matches the application's: with users.read.all you see the whole company; with only users.read.area, just those sharing an area with the credential's owning user.

Query

pageintegerdefaults to 1

Page number, starting at 1.

sizeintegerdefaults to 50

Items per page. Maximum 200.

searchstring

Filters by name or email, case-insensitively.

Returns

idinteger

The value for shared_user_ids.

namestring

Name.

emailstring

Email.

is_activeboolean

Whether they can sign in.

area_idsinteger[]

Areas they belong to.

curl -sS -X GET 'https://api.niucore.com/api/v1/users?page=1&size=50' \
  -H "Authorization: Bearer $NIUCORE_ACCESS_TOKEN"
Response
{
  "status": "success",
  "message": "Operación exitosa",
  "message_code": "api_v1_ok",
  "data": [
    {
      "id": 2099,
      "name": "Ada Lovelace",
      "email": "ada@acme.com",
      "is_active": true,
      "area_ids": [
        7,
        9
      ]
    },
    {
      "id": 2104,
      "name": "Grace Hopper",
      "email": "grace@acme.com",
      "is_active": true,
      "area_ids": [
        7
      ]
    }
  ],
  "meta": {
    "request_id": "9f1c0a3e-7b2d-4f18-9a55-2c6e0d1b4a77",
    "page": 1,
    "size": 50,
    "total": 2
  }
}