Using Generic Entities

A Generic Entity is a major BioT platform feature that allows you to create templates, and entities of that template, that represent data structures or flows of your business logic.
To learn more about the creation of generic entities templates and uses, click here.

Working With Generic Entities

Once you have created a generic entity template from the BioT Console, you'll be able to create an instance of it by following these steps:

  1. Locate the organization that the device/user belongs to
  2. Make an API call to create an instance

Locate the organization that the device/user belongs to

Each device or user belongs to an organization. When a user logs in, it will get the organization ID as part of the log in response. A device can get its organization ID by querying its own details.

To obtain an organization unique ID, use the following API:

GET https://your-biot-domain.com/device/v2/devices/

See Generic Entity Usage Example - Log File for an exact example.

Make an API call to create an instance

To create an instance of the generic entity, make the following API call:

V1 example: POST https://your-biot-domain.com/generic-entity/v1/generic-entities/templates/device_log

V3 example: POST https://your-biot-domain.com/generic-entity/v3/generic-entities/device_log

{
     "_ownerOrganization": {
          "id": "b000a36e-6d67-4735-a85c-bd6a8b8f0e9d"
     },
     "_name": "generic_entity_name",
     <generic_entity_custom_attributes>
}

V3 allows you to call a specific generic entity template directly by name in the URL, rather than passing _templateId in the request body.

📘

Note

The generic entity name must be unique and have a max length of 32 characters

Use the _ownerOrganization and _templateId values obtained from the previous steps.

In the generic_entity_custom_attributes section, add the values of custom attributes added to the generic entity template.

⚠️

Generic Entity API version - read this

Two versions of the Generic Entity API are shown above: V1 and V3.

  • V1 is available to all BioT customers on all versions and remains fully supported.
  • V3 is available from BioT version 2.3.40 and requires activation by BioT. To request it, contact BioT Support.

Not sure which version your environment is on? Check the bottom-left corner of your BioT Portal.