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 OMF request and response

  • Last UpdatedSep 04, 2025
  • 2 minute read

The following is an example OMF request.

POST /piwebapi/omf HTTP/1.1
Host: localhost:443
omfversion: 1.1
messagetype: data
messageformat: json
action: create
producertoken: Max

[

{

"typeid": "ATypeIdWhichDoesNotExist",

"values": [

{

"IndexProperty": "MyFirstStaticInstance",

"ValuePropertyOne": "First value",

"ValuePropertyTwo": "Second value"

},

{

"IndexProperty": "MySecondStaticInstance",

"ValuePropertyOne": "First value",

"ValuePropertyTwo": "Second value"

}

]

},

{

"containerid": "AContainerThatExists",

"values": [

{

"Time": "2017-01-01T00:00:00Z",

"Value": "foo"

},

{

"Time": "2017-01-02T00:00:00Z",

"Value": "bar"

},

{

"Time": "2017-01-03T00:00:00Z",

"Value": "baz"

}

]

},

{

"typeid": "__Link",

"values": [

{

"source": {

"typeId": "ATypeIDWhichDoesNotExist",

"index": "MyFirstStaticInstance"

},

"target": {

"typeId": "ATypeIdWhichDoesNotExist",

"index": "MySecondStaticInstance"

}

}

]

}

]

The following is the response for the preceding example OMF request. This example shows how the response types can be nested within each other. The text of the responses are not actual valid responses.

{
"OperationId": "650244c4-fb51-4566-9170-7df7439586a3",
"Messages": [
{
"MessageIndex": 0,
"Events": [
{
"Event": {
"Message": "A type ID was specified, but version was omitted; proceeding with default version '1.0.0.0'.",
"Reason": "The 'TypeVersion' field is optional, but recommended.",
"Suggestions": [
"Include an explicit 'TypeVersion' field."
],
"EventCode": 1800,
"Severity": "Warning",
"Parameters": [
{
"Name": "TypeID",
"Value": "ATypeIdWhichDoesNotExist"
}
]
},
"ExceptionInfo": null,
"InnerEvents": []
},
{
"Event": {
"Message": "A type definition with the specified ID and version does not exist.",
"Reason": "Creating static data instances requires a pre-existing type definition.",
"Suggestions": [
"Specify a type ID and version which already exist.",
"Create a type with the specified ID and version before using it."
],
"EventCode": 8675,
"Severity": "Error",
"Parameters": [
{
"Name": "TypeID",
"Value": "ATypeIdWhichDoesNotExist"
},
{
"Name": "TypeVersion",
"Value": "1.0.0.0"
}
]
},
"ExceptionInfo": {
"Type": "OSIsoft.OMF.Loggers.OmfLoggableException",
"Message": "A type definition with the specified ID and version does not exist."
},
"InnerEvents": []
},
{
"Event": {
"Message": "Buffer successfully flushed, but was not empty; message contents were not completely stored.",
"Reason": "The message buffer flushed without encountering an error, but the buffer was not empty after the flush.",
"Suggestions": [
"Contact your system administrator.",
"Verify your OMF system has not entered an illegal state.",
"Restart your PI Web API service."
],
"EventCode": 309,
"Severity": "Critical",
"Parameters": [
{
"Name": "Buffer",
"Value": "OSIsoft.OMF.Storage.PI.AssetServerInstanceBuffer"
}
]
},
"ExceptionInfo": {
"Type": "OSIsoft.OMF.Loggers.OmfLoggableException",
"Message": "Buffer successfully flushed, but was not empty; message contents were not completely stored."
},
"InnerEvents": []
}
],
"Status": {
"Code": 500,
"HighestSeverity": "Critical"
}
},
{
"MessageIndex": 1,
"Events": [
{
"Event": {
"Message": "The specified static link source did not exist.",
"Reason": "Creating static instance links requires that the source and target already exist.",
"Suggestions": [
"Specify a source that already exists.",
"Create a static instance that satisfies the specified 'typeid' and 'index'."
],
"EventCode": 555,
"Severity": "Error",
"Parameters": [
{
"Name": "SourceTypeId",
"Value": "ATypeIdWhichDoesNotExist"
},
{
"Name": "SourceIndex",
"Value": "MyFirstStaticInstance"
}
]
},
"ExceptionInfo": {
"Type": "OSIsoft.OMF.Loggers.OmfLoggableException",
"Message": "The specified static link source did not exist."
},
"InnerEvents": [
{
"Event": {
"Message": "Type not found.",
"Reason": null,
"Suggestions": [],
"EventCode": 556,
"Severity": "Error",
"Parameters": [
{
"Name": "TypeId",
"Value": "ATypeIdWhichDoesNotExist"
}
]
},
"ExceptionInfo": {
"Type": "OSIsoft.OMF.Loggers.OmfLoggableException",
"Message": "Type not found."
},
"InnerEvents": []
}
]
}
],
"Status": {
"Code": 404,
"HighestSeverity": "Error"
}
}
]
}

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