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 template unique ID
  2. Locate the organization that the device/user belongs to
  3. Make an API call to create an instance

Locate the template unique ID

Use the following API:

GET https://your-biot-domain.com/settings/v1/templates/minimized

You can use the filter search parameter to search for the template by its name attribute.
See Using BioT Search APIs for a detailed explanation on how to use this API, or Generic Entity Usage Example - Log File for an exact example.

From the search result, save the unique template ID.

📘

Note

You do not need to repeat this step every time you need to create an instance of a generic entity.
You may do this once, when your application loads, and save the ID for later use.

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:

POST https://your-biot-domain.com/generic-entity/v1/generic-entities

{
     "_ownerOrganization": {
          "id": "b000a36e-6d67-4735-a85c-bd6a8b8f0e9d"
     },
     "_name": "generic_entity_name",
     "_templateId": "7c902e75-13fc-42b2-a7cc-b9f974a3d615"
     <generic_entity_custom_attributes>
}

📘

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.