API DocsRESTChannel schema service

CreateChannelSchema

Create a channel schema

POST
/api/v1/channel-schemas

Request Body

application/jsonRequired

The request for a call to ChannelSchemaService_CreateChannelSchema.

componentstring

The name of the component (case-insensitive).

channel
Required
string

The name of the channel (case-insensitive).

unitstring

dataType
Required
string

Default: "CHANNEL_DATA_TYPE_UNSPECIFIED"Value in: "CHANNEL_DATA_TYPE_UNSPECIFIED" | "CHANNEL_DATA_TYPE_DOUBLE" | "CHANNEL_DATA_TYPE_STRING" | "CHANNEL_DATA_TYPE_ENUM" | "CHANNEL_DATA_TYPE_BIT_FIELD" | "CHANNEL_DATA_TYPE_BOOL" | "CHANNEL_DATA_TYPE_FLOAT" | "CHANNEL_DATA_TYPE_INT_32" | "CHANNEL_DATA_TYPE_UINT_32" | "CHANNEL_DATA_TYPE_INT_64" | "CHANNEL_DATA_TYPE_UINT_64"

enumTypesarray<object>

bitFieldElementsarray<object>

assetName
Required
string

The name of the asset (case-insensitive).

organizationIdstring

This field is optional if the caller belongs to a single organization.

curl -X POST "<API_URL>/api/v1/channel-schemas" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "component": "string",
    "channel": "string",
    "unit": "string",
    "dataType": "CHANNEL_DATA_TYPE_UNSPECIFIED",
    "enumTypes": [
      {
        "name": "string",
        "key": 0
      }
    ],
    "bitFieldElements": [
      {
        "name": "string",
        "index": 0,
        "bitCount": 0
      }
    ],
    "assetName": "string",
    "organizationId": "string"
  }'

A successful response.

{}