evalinkdocs

Recipes

Step-by-step integrations built from published operations, each with curl examples.

ReferenceAPI: recipes — Recipe: list the open alarms of a site

In evalink talos, a "site" is represented by a device group: devices are linked to it through their deviceGroupId, and alarms carry the same deviceGroupId (plus the full group path in dgPath). There is no single endpoint that filters open alarms by one site directly, so the recipe combines two calls.

  1. Find the site's device group id. Call device-service.getDeviceGroupsByCompanyId to list the company's device groups and pick the one that represents the site:
curl -H 'Authorization: Bearer <token>' \
  'https://talos.evalink.io/api/device-service/device-groups/search/findByCompanyId?companyId=<companyId>'

Note the id of the matching device group — this is <siteId> below.

  1. Fetch the company's open alarms. Call alarm-service.getOpenedByCompanyV2, which always returns alarms in status NEW only (not IN_WORK or CLOSED) for the given company, paginated:
curl -H 'Authorization: Bearer <token>' \
  'https://talos.evalink.io/api/alarm-service/alarms-thin/v2/open?companyId=<companyId>&page=0&size=200'

Each returned alarm includes deviceGroupId and dgPath (the ancestor chain of device groups). Keep only the alarms whose deviceGroupId equals <siteId>, or whose dgPath contains it, to scope the result to one site.

  1. Page through the rest. size defaults to 5000 and is capped at 20000; hasNextPage in the response tells you whether to request the next page. The optional headerNames query parameter can be repeated to also return specific alarm headers (for example a webhook's web-hook-id header, see the webhook recipe) in each alarm's headers map.

  2. Look up one alarm's full detail with alarm-service.alarms.get once you have its id:

curl -H 'Authorization: Bearer <token>' \
  'https://talos.evalink.io/api/alarm-service/alarms/<id>'

Or, to check whether one specific device currently has an open alarm, use alarm-service.alarms.search.findByDeviceIdAndAlarmStatus with alarmStatus=NEW instead of scanning the whole company.

ReferenceAPI: recipes — Recipe: onboard a device

Onboarding a device means creating a device group for its site (if it does not exist yet) and then creating the device itself, linked to that group.

  1. Create the site's device group, if it doesn't already exist, with device-service.device-groups.create (POST /api/device-service/device-groups). The type field accepts DEVICE_GROUP, OU or SERVICE_COMPANY. The call returns 201 with the stored group:
curl -X POST -H 'Authorization: Bearer <token>' -H 'Content-Type: application/json' \
  -d '{"companyId":"<companyId>","name":"Main Street 12","type":"DEVICE_GROUP"}' \
  'https://talos.evalink.io/api/device-service/device-groups'

Keep the returned id as <deviceGroupId>.

  1. Create the device with device-service.devices.create (POST /api/device-service/devices). The schema lists every field as optional, but the platform rejects a device without companyId and evalinkDeviceId. source defaults to TALOS if omitted, and deviceGroupId links the device to the site created above. The device group must exist and belong to the same company as the device, otherwise the request fails with a bad-request error:
curl -X POST -H 'Authorization: Bearer <token>' -H 'Content-Type: application/json' \
  -d '{"companyId":"<companyId>","evalinkDeviceId":"<uniqueDeviceId>","name":"Front door panel","deviceGroupId":"<deviceGroupId>","communicationProtocol":"CONTACT_ID"}' \
  'https://talos.evalink.io/api/device-service/devices'

The response (201) echoes the stored device, including a generated id. If you omit active, the new device is created active.

  1. Verify placement by reading the device back with GET /api/device-service/devices/<id>; its deviceGroupId (and deviceGroupName) shows the site it belongs to.

Notes: companyId is fixed at creation and cannot be changed afterwards. communicationProtocol is optional and accepts CONTACT_ID, SIA or EVALINK.

ReferenceAPI: recipes — Recipe: alarms raised through a webhook

evalink talos can raise an alarm whenever an external system calls a per-device webhook URL. This recipe shows how to verify the resulting alarms through the published alarm API; no webhook management operation is used here.

  1. The external system calls the webhook URL it was given to raise an alarm.

  2. Talos turns that call into a normal alarm on the device the webhook is bound to. The alarm carries the headers x-source = web-hook and web-hook-id = the id of the webhook.

  3. Confirm delivery over the API by listing the company's open alarms and requesting those headers with headerNames:

curl -H 'Authorization: Bearer <token>' \
  'https://talos.evalink.io/api/alarm-service/alarms-thin/v2/open?companyId=<companyId>&headerNames=x-source&headerNames=web-hook-id'

Each alarm's headers map then shows which webhook raised it.

  1. Or check one device directly with alarm-service.alarms.search.findByDeviceIdAndAlarmStatus (both parameters are required; alarmStatus accepts INITIAL, NEW, IN_WORK, CLOSED):
curl -H 'Authorization: Bearer <token>' \
  'https://talos.evalink.io/api/alarm-service/alarms/search/findByDeviceIdAndAlarmStatus?deviceId=<deviceId>&alarmStatus=NEW'

A webhook configured for periodic supervision must be called at its interval; if it expires, talos raises a supervision alarm, provided the webhook integration is enabled for the company. Without that integration no alarm is created.