Example container message
- Last UpdatedSep 04, 2025
- 2 minute read
Example container message for simple dynamic type
When a type has exactly one value property, it is considered "simple" by the PI Web API. The OMF Container is created using a simple type are named like $"{container.id}". The following is an example container message for a dynamic type with an ID of simple-dynamic-type1.
Authorization: {your own value}
Content-Type: application/json
omfversion: 1.2
messagetype: container
action: create
messageformat: json
[
{
"id": "simple-container1",
"typeid": "simple-dynamic-type1",
"datasource": "OPCUA",
"indexes": [
"Pressure"
],
"extrapolation": "forward"
}
]
This message creates a PI Point named simple-container1 as shown in the following image.
Example container message for complex dynamic type
When a type has more than one value property, it is considered "complex" by the PI Web API. The OMF Container created using a complex type are named like $"{container.id}.{property.index}". The following is an example container message that uses a complex type.
Authorization: {your own value}
Content-Type: application/json
omfversion: 1.2
messagetype: container type
action: create
messageformat: json
[
{
"id": "Widget1",
"typeid": "Widget"
}
]
This message creates the PI Points Widget1.WidgetMode and Widget1.Widgetness as shown in the following image.
Example container message for all keywords
The following is an example container message that extends the previous example by including a value for all keywords.
Authorization: {your own value}
Content-Type: application/json
omfversion: 1.2
messagetype: container type
action: create
messageformat: json
[
{
"id": "Widget1",
"typeid": "Widget",
"name": "First Widget",
"description": "The first widget.",
"datasource": "widgetbase.1",
"tags": [
"WidgetRelated",
"OtherTag"
],
"metadata": {
"MetadataKeyOne": "valueOne",
"MetadataKeyTwo": "valueTwo",
"MetadataKeyThree": 12345
},
"indexes": [
"Widgetness"
],
"extrapolation": "all",
"propertyoverrides": {
"Widgetness": {
"name": "Widgetry",
"description": "This is my replacement description.",
"minimum": 15.0,
"maximum": 85.0,
"uom": "percent",
"interpolation": "discrete"
}
}
}
]
This example creates the PI Points Widget1.WidgetMode and Widget1.Widgetness as shown in the following image.
Note that some keywords included in the message were ignored because they are not supported by the PI Web API.
The ignored keywords are:
-
tags
-
indexes
-
Parts of propertyoverrides:
-
name
-
description
Note: Even if the PI Web API does not support a keyword, if you include it in a message, it should still be valid according to the OMF specification. For example, if the indexes array had contained an incorrect value (ex. "foo"), the PI Web API would have returned an error even though it does not support indexes.
-