Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

OMF with PI Web API

Example static data message

  • Last UpdatedSep 04, 2025
  • 2 minute read

The following is a sample data message request that will create a static OMF Data message. You can copy this sample and modify it for your use.

Note: To bypass the PI Web API CSRF defense setting, add an X-Requested-With header with any value to the OMF HTTP request. For additional headers supported in message specification, see Message headers.

Authorization: {your own value}
Content-Type: application/json
omfversion: 1.2
messagetype: data
action: create
messageformat: json
[

{

"typeid": "WidgetFactory",

"values": [

{

"FactoryId": "Factory1",

"FactoryName": "Meridian Ave Widget Factory",

"Address": "123 Meridian Ave",

"Contact": "Robert Ross",

"WidgetLevel": 8675.309

},

{

"FactoryId": "Factory2",

"FactoryName": "Brook Lane Widget Factory",

"Address": "28 Brook Lane",

"Contact": "Max Jones",

"WidgetLevel": 123.456

}

]

}

]

This example creates the following elements:

  • Brook Lane Widget Factory

  • Meridian Ave Widget Factory

The first element, Brook Lane Widget Factory, has the following attributes:

  • Address

  • Contact

  • Widget Level

  • Widget Color

Type-less Data Message Example

Optionally, a typeid may be specified along with the properties to extend a static Type with additional properties. In the following example, the Data message extends the 'Tank' type to include 'Description' and 'ModelRevision' properties. These additional properties for are only for this instance; the 'Tank' Type itself is not extended.

[

{

"typeid": "Tank",

"properties": {

"Description": {

"type": "string"

},

"ModelRevision": {

"type": "integer",

"format": "uint16"

}

},

"values": [

{

"TankName": "Tank1",

"Serial": "5236-3523-KKF4",

"Model": "FN-2187",

"Description": "Tank in Building C11",

"ModelRevision": 3

}

]

}

]

This example creates an element with the following attributes:

Note: If a property is defined on the Type definition or the extended properties list, and that property is not included in the values array, then a default value for that property will be used. Default values are specified in the Supported Formats table.

Related Links
TitleResults for “How to create a CRG?”Also Available in