An Industrial IOT Platform

Web API Documentation

Once Open-Plant (Full Version) is installed, Open-Plant provides Web API endpoints which return JSON data about tags, users, and most importantly data values from the connected devices. There are no special licenses for this. Web APIs are accessible even on the free version. The base Web API Address is 'https//127.0.0.1:33170/api' for secure https and 'https://127.0.0.1:33171/api' for unsecure http endpoints. All request must use the appropriate HTTP verbs (GET, POST, PUT, DELETE).

Read Only APIs

GET

User

This API gets the requested user and it's details in a JSON object. The user calling this API must have the same or higher access level the the requested user.

Examples:
https://127.0.0.1:33170/api/users/azrinsani
https://127.0.0.1:33170/api/users/administrator
Returns (JSON):
{
    "data": {
        "Username": "Administrator",
        "UserRole": 10,
        "AccessLevel": 10,
        "FullName": "",
        "Email": ""
    }
}
GET

User(s)

This API lists users and it's details in a JSON object. A search 'wildcard' parameter can be passed as a parameter. The wildcard search is NOT case sensitive. This API will only return users which has the same or lower access level the the calling user.

Examples:
https://127.0.0.1:33170/api/users
https://127.0.0.1:33170/api/users?wildcard=*admin*
Returns (JSON):
{
    "data": [
        {
            "Username": "Administrator",
            "UserRole": 10,
            "AccessLevel": 10,
            "FullName": "",
            "Email": ""
        },
        {
            "Username": "Guest",
            "UserRole": 1,
            "AccessLevel": 1,
            "FullName": "",
            "Email": ""
        }
    ]
}
{
    "data": [
        {
            "Username": "Administrator",
            "UserRole": 10,
            "AccessLevel": 10,
            "FullName": "",
            "Email": ""
        }
    ]
}
GET

Authenticate User

This API authenticates a user based on it's 'username' and 'password'. Alternatively a 'passwordhash' can be provided. Password hash can be generated by applying a SHA256 hashing algorithm on the actual password. 

This API can only be used to authenticate a user which has the same or lower access level the the calling user. If not a '403-Forbidden' error will be thrown.

This API will return the user object and a 'passwordcorrect' variable, which will return 'true' if the password provided is correct

Examples:
https://127.0.0.1:33170/api/authenticate?username=administrator&password=admin
https://127.0.0.1:33170/api/authenticate?username=administrator&passwordhash=8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918
Returns (JSON):
{
    "data": {
        "Username": "Administrator",
        "UserRole": 10,
        "AccessLevel": 10,
        "FullName": "",
        "Email": ""
    },
    "passwordcorrect": true
}
GET

Tag List

This API gets a simple list of tag with no details in a JSON object. A search 'wildcard' parameter can be passed as parameter. Both the 'wildcard' and 'TagIds' parameter are NOT case sensitive.

Examples:
https://127.0.0.1:33170/api/taglist
https://127.0.0.1:33170/api/taglist?wildcard=*.pv
Returns (JSON):
{
    "data": [
        "FIC101.pv",
        "FIC101.mv",
        "FIC101.sv",
        "FIC102.pv",
        "FIC102.mv",
        "FIC102.sv"
    ]
}
{
    "data": [
        "FIC101.pv",
        "FIC102.pv"
    ]
}
GET

Tag

This API returns a single tag with it's details in a JSON object. In Open-Plant Tag Ids are not case sensitive. 'LiveValue' and 'LastValue' sub-objects returns three types of time stamps. 'TSUTC' means time stamp is in UTC Format. 'TSLocal' means time stamp is in local server time. The '_ISO' postfix  on 'tsutc' means that the time stamp is formated to ECMA/ISO8601 format, convenient for Java Script code (vs the default UNIX timestamp).

Example:
https://127.0.0.1:33170/api/tags/random.real4
https://127.0.0.1:33170/api/tags/Random.Real4   //This is same as above. Tag Ids are not case sensitive.
https://127.0.0.1:33170/api/tags/fic101.pv
Returns (JSON):
{
    "data": {
        "Id": "Random.Real4",
        "TagName": "Random",
        "Parameter": "Real4",
        "UnitOfMeasure": "",
        "Description": "",
        "Corporate": "",
        "Plant": "",
        "Area": "",
        "Unit": "",
        "Param1": "",
        "Param2": "",
        "Param3": "",
        "Param4": "",
        "Param5": "",
        "Param6": "",
        "Param7": "",
        "Param8": "",
        "Param9": "",
        "DataType": 0,		// Real=0, Int=1, Bool=2
        "InterpType": 1,	// Linear=1, Digital=2
        "SampleTimeoutInS": 180,
        "CacheSizeInNumberOfItems": 3600,
        "DuplicateThresholdInMS": 250,
        "DatabaseLocation": "pv_random.real4",
        "LiveValue": null,
        "LastValue": {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T14:25:48.000",
            "TSUTC": "/Date(1565907948000+0800)/",
            "TSUTC_ISO": "2019-08-16T06:25:48.000Z",
            "Value": 18379.64
        }
    }
}
GET

Tags

This API gets a list of tags with it's details in a JSON object. In Open-Plant Tag Ids are not case sensitive. A search 'wildcard' parameter can be passed as parameter. This wildcard search too is NOT case sensitive. 'LiveValue' and 'LastValue' sub-objects returns three types of time stamps. 'TSUTC' means time stamp is in UTC Format. 'TSLocal' means time stamp is in local server time. The '_ISO' on 'tsutc' means that the time stamp is formated to ECMA/ISO8601 format, convenient for Java Script code vs the default UNIX timestamp.

Examples:
https://127.0.0.1:33170/api/tags
https://127.0.0.1:33170/api/tags?wildcard=random.real4
Returns (JSON):
{
    "data": [
        {
            "Id": "Random.Real4",
            "TagName": "Random",
            "Parameter": "Real4",
            "UnitOfMeasure": "",
            "Description": "",
            "Corporate": "",
            "Plant": "",
            "Area": "",
            "Unit": "",
            "Param1": "",
            "Param2": "",
            "Param3": "",
            "Param4": "",
            "Param5": "",
            "Param6": "",
            "Param7": "",
            "Param8": "",
            "Param9": "",
            "DataType": 0,     	// Real=0, Int=1, Bool=2
            "InterpType": 1,	// Linear=1, Digital=2	
            "SampleTimeoutInS": 180,
            "CacheSizeInNumberOfItems": 3600,
            "DuplicateThresholdInMS": 250,
            "DatabaseLocation": "pv_random.real4",
            "LiveValue": {
                "IsError": false,
                "TSLocal_ISO": "2019-08-16T11:48:28.561",
                "TSUTC": "/Date(1565927308561)/",
                "TSUTC_ISO": "2019-08-16T03:48:28.561Z",
                "Value": 22754.1172
            },
            "LastValue": {
                "IsError": false,
                "TSLocal_ISO": "2019-08-16T11:48:28.561",
                "TSUTC": "/Date(1565927308561)/",
                "TSUTC_ISO": "2019-08-16T03:48:28.561Z",
                "Value": 22754.1172
            }
        },
        {
            "Id": "Random.Int1",
            "TagName": "Random",
            "Parameter": "Int1",
            "UnitOfMeasure": "",
            "Description": "",
            "Corporate": "",
            "Plant": "",
            "Area": "",
            "Unit": "",
            "Param1": "",
            "Param2": "",
            "Param3": "",
            "Param4": "",
            "Param5": "",
            "Param6": "",
            "Param7": "",
            "Param8": "",
            "Param9": "",
            "DataType": 0,
            "InterpType": 1,
            "SampleTimeoutInS": 180,
            "CacheSizeInNumberOfItems": 3600,
            "DuplicateThresholdInMS": 250,
            "DatabaseLocation": "pv_random.int1",
            "LiveValue": {
                "IsError": false,
                "TSLocal_ISO": "2019-08-16T11:48:27.542",
                "TSUTC": "/Date(1565927307542)/",
                "TSUTC_ISO": "2019-08-16T03:48:27.542Z",
                "Value": 100
            },
            "LastValue": {
                "IsError": false,
                "TSLocal_ISO": "2019-08-16T11:48:27.542",
                "TSUTC": "/Date(1565927307542)/",
                "TSUTC_ISO": "2019-08-16T03:48:27.542Z",
                "Value": 100
            }
        }
    ]
}
{
    "data": [
        {
            "Id": "Random.Real4",
            "TagName": "Random",
            "Parameter": "Real4",
            "UnitOfMeasure": "",
            "Description": "",
            "Corporate": "",
            "Plant": "",
            "Area": "",
            "Unit": "",
            "Param1": "",
            "Param2": "",
            "Param3": "",
            "Param4": "",
            "Param5": "",
            "Param6": "",
            "Param7": "",
            "Param8": "",
            "Param9": "",
            "DataType": 0,		// Real=0, Int=1, Bool=2
            "InterpType": 1,		// Linear=1, Digital=2
            "SampleTimeoutInS": 180,
            "CacheSizeInNumberOfItems": 3600,
            "DuplicateThresholdInMS": 250,
            "DatabaseLocation": "pv_random.real4",
            "LiveValue": {
                "IsError": false,
                "TSLocal_ISO": "2019-08-16T12:22:10.662",
                "TSUTC": "/Date(1565929330662)/",
                "TSUTC_ISO": "2019-08-16T04:22:10.662Z",
                "Value": 12780.19,
                "AggMark": false
            },
            "LastValue": {
                "IsError": false,
                "TSLocal_ISO": "2019-08-16T12:22:10.662",
                "TSUTC": "/Date(1565929330662)/",
                "TSUTC_ISO": "2019-08-16T04:22:10.662Z",
                "Value": 12780.19,
                "AggMark": false
            }
        }
    ]
}
GET

Value

This API gets the current 'Value' or 'Last Value' of a Tag Id. In Open-Plant, Tag Ids are not case sensitive. When 'Value' is requested without any timestamp parameter, Open-Plant will take the most fresh and live value. This value needs to honor the set Sample Timeout, a property of each tag (see SampleTimeoutInS in 'Returns (JSON)' GET Tag section). If the value obtained is older than the set Sample Timeout, a null value is returned (as shown in 'Examples' below). 

'Value' can also requested be with a 'timestamp', where Open-Plant returns the interpolated value at that time. The timetsamp needs to be in ISO formats such as 'YYYY-MM-dd hh:mm:ss.ttt' and in UTC. The timestamp parameters also accepts semantics such as 'now', 'now-1d', and etc as shown in 'Examples' below.

When 'LastValue' is requested, the sample timeout parameter is ignored. 'timestamp' parameter is not valid for 'LastValue' request.

Examples:
https://127.0.0.1:33170/api/tags/Random.Real4/value
https://127.0.0.1:33170/api/tags/Random.Real4/value?timestamp=now		//Get current data. Same as above.
https://127.0.0.1:33170/api/tags/Random.Real4/value?timestamp=now-1d		//Get data 1 day ago
https://127.0.0.1:33170/api/tags/Random.Real4/value?timestamp=now-10m		//Get data 10 minues ago
https://127.0.0.1:33170/api/tags/Random.Real4/value?timestamp=now-3h		//Get data 3 hours ago
https://127.0.0.1:33170/api/tags/Random.Real4/value?timestamp=now-5s		//Get data 5 seconds ago
https://127.0.0.1:33170/api/tags/Random.Real4/value?timestamp=2019-08-16 13:43:10
https://127.0.0.1:33170/api/tags/Random.Real4/value?timestamp=2019-08-16 03:43:12.432
https://127.0.0.1:33170/api/tags/Random.Real4/value?timestamp=2019-08-16T03:43:12.432Z
https://127.0.0.1:33170/api/tags/Random.Real4/lastvalue
Returns (JSON):
{
    "data": null
}
{
    "data": 18379.64
}
GET

Sample

This API gets the current 'Sample' or 'Last Sample' of a Tag Id. In Open-Plant Tag Ids are not case sensitive. A 'Sample' is akin to a data point, which has 'time stamp', 'value' and an 'Error' flag.  When 'Sample' is requested without any timestamp parameter, Open-Plant will take the most fresh and live sample. This sample needs to honor the set Sample Timeout, a property of each tag (see SampleTimeoutInS in 'Returns (JSON)' GET Tag section). If the sample obtained is older than the set Sample Timeout, a null value is returned (as shown below). The sample objects return three types of time stamps. 'TSUTC' means time stamp is in UTC Format. 'TSLocal' means time stamp is in local server time. '_ISO' means time stamp is formated to ECMA/ISO8601 format, convenient for Java Script code vs the default UNIX timestamp.

'Sample' can also requested be requested with a 'timestamp', where Open-Plant returns the interpolated sample at that time. The timetsamp needs to be in ISO formats such as 'YYYY-MM-dd hh:mm:ss.ttt' and in UTC. The timestamp parameters also accepts semantics such as 'now', 'now-1d', and etc as shown in 'Examples' below.

When 'LastSample' is requested, the sample timeout parameter is ignored. 'timestamp' parameter is not valid for this request.

Examples:
https://127.0.0.1:33170/api/tags/Random.Real4/sample
https://127.0.0.1:33170/api/tags/Random.Real4/sample?timestamp=now		//Get current data. Same as above.
https://127.0.0.1:33170/api/tags/Random.Real4/sample?timestamp=now-1d		//Get data 1 day ago.
https://127.0.0.1:33170/api/tags/Random.Real4/sample?timestamp=now-10m		//Get data 10 minues ago.
https://127.0.0.1:33170/api/tags/Random.Real4/sample?timestamp=now-3h		//Get data 3 hours ago.
https://127.0.0.1:33170/api/tags/Random.Real4/sample?timestamp=now-5s		//Get data 5 seconds ago.
https://127.0.0.1:33170/api/tags/Random.Real4/sample?timestamp=2019-08-16 13:43:10
https://127.0.0.1:33170/api/tags/Random.Real4/sample?timestamp=2019-08-16 03:43:12.432
https://127.0.0.1:33170/api/tags/Random.Real4/sample?timestamp=2019-08-16T03:43:12.432Z
https://127.0.0.1:33170/api/tags/Random.Real4/lastsample
Returns (JSON):
{
    "data": {
        "IsError": false,
        "TSLocal_ISO": "2019-08-16T16:31:38.007",
        "TSUTC": "/Date(1565944298007)/",
        "TSUTC_ISO": "2019-08-16T08:31:38.007Z",
        "Value": null
    }
}
{
    "data": {
        "IsError": false,
        "TSLocal_ISO": "2019-08-16T14:25:48.000",
        "TSUTC": "/Date(1565907948000+0800)/",
        "TSUTC_ISO": "2019-08-16T06:25:48.000Z",
        "Value": 18379.64
    }
}
GET

Value(s)

This API gets an array of 'Values' or 'LastValues' for a specified set of 'TagIds'. One or more 'TagIds' can be specified with commas(,) separating them. In Open-Plant Tag Ids are not case sensitive. When 'Values' is called without any timestamp parameter, Open-Plant will take the most fresh and live values for each specified tag. These values needs to honor the set Sample Timeout, a property of each tag (see SampleTimeoutInS in 'Returns (JSON)' GET Tag section). If the values obtained are older than the set Sample Timeout, a null value is returned (as shown in 'Examples' below).

When a timestamp parameter is specified, Open-Plant returns the interpolated value at that time. The timetsamp needs to be in ISO formats such as 'YYYY-MM-dd hh:mm:ss.ttt' and in UTC. The timestamp parameters also accepts semantics such as 'now', 'now-1d', and etc as shown in the example below.

When 'LastValues' is requested, the sample timeout parameter is ignored. 'timestamp' parameter is not valid for this request.

Examples:
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1&timestamp=now		//Get current. Same as above.
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1&timestamp=now-1d		//Get data 1 day ago.
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1&timestamp=now-10m		//Get data 10 minues ago.
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1&timestamp=now-3h		//Get data 3 hours ago.
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1&timestamp=now-5s		//Get data 5 seconds ago.
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1&timestamp=2019-08-16 13:43:10
https://127.0.0.1:33170/api/values?tagids=Random.Real4,Random.Int1&timestamp=2019-08-16T03:43:12.432Z
https://127.0.0.1:33170/api/lastvalues?tagids=Random.Real4,Random.Int1
Returns (JSON):
{
    "data": [
        null,	//A null is returned when the TagId specified does not exist
        null	//and also if the value has expired (older than sample timeout)
    ]
}
{
    "data": [
        14095.179039999999,
        41.968
    ]
}
GET

Sample(s)

This API gets an array of 'Samples' or 'LastSamples' for a specified set of 'TagIds'. One or more 'TagIds' can be specified with commas(,) separating them. In Open-Plant Tag Ids are not case sensitive. A 'Sample' is akin to a data point, which has 'time stamp', 'value' and an 'Error' flag. When 'Samples' is called without any timestamp parameter, Open-Plant will take the most fresh and live samples from each specified tags. These samples need to honor the set Sample Timeout, a property of each tag (see SampleTimeoutInS in 'Returns (JSON)' GET Tag section). If the samples obtained are older than the set Sample Timeout, a null value is returned (as shown in 'Examples' below).

When a timestamp parameter is specified, Open-Plant returns the interpolated value at that time. The timetsamp needs to be in ISO formats such as 'YYYY-MM-dd hh:mm:ss.ttt' and in UTC. The timestamp parameters also accepts semantics such as 'now', 'now-1d', and etc as shown in the example below.

When 'LastSamples' is requested, the sample timeout parameter is ignored. 'timestamp' parameter is not valid for this request.

Examples:
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1&timestamp=now		//Get current. Same as above.
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1&timestamp=now-1d		//Get data 1 day ago.
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1&timestamp=now-10m		//Get data 10 minues ago.
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1&timestamp=now-3h		//Get data 3 hours ago.
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1&timestamp=now-5s		//Get data 5 seconds ago.
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1&timestamp=2019-08-16 13:43:10
https://127.0.0.1:33170/api/samples?tagids=Random.Real4,Random.Int1&timestamp=2019-08-16T03:43:12.432Z
https://127.0.0.1:33170/api/lastsamples?tagids=Random.Real4,Random.Int1
Returns (JSON):
{
    "data": [
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:12.432Z",
            "TSUTC": "/Date(1565926992432)/",
            "TSUTC_ISO": "2019-08-16T03:43:12.432Z",
            "Value": 14095.179039999999
        },
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:12.432Z",
            "TSUTC": "/Date(1565926992432)/",
            "TSUTC_ISO": "2019-08-16T03:43:12.432Z",
            "Value": 41.968
        }
    ]
}
{
    "data": [
        null,		//A null is returned when the Tag Id Specified does not exist
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:12.432",
            "TSUTC": "/Date(1565926992432)/",
            "TSUTC_ISO": "2019-08-16T03:43:12.432Z",
            "Value": 41.968
        }
    ]
}
GET

Sample(s) Series

This API gets a series/array of 'Samples' for a 'TagId'. In Open-Plant Tag Ids are not case sensitive. A 'Sample' is akin to a data point, which has 'time stamp', 'value' and an 'Error' flag. Parameters 'from' and 'to' needs to be specified with a timestamp. The timetsamp needs to be in ISO formats such as 'YYYY-MM-dd hh:mm:ss.ttt' and in UTC. These parameters also accepts semantics such as 'now', 'now-1d', and etc as shown in 'Examples' below. If parameters 'from' and 'to'  are not specified, a '400 Bad Request' error will be shown. 

The sample series will return samples every 1 second between 'from' and 'to'. This interval can be changed by specifying an 'interval' parameter which is a value in miliseconds

The sample series output will always honor the set Sample Timeout, a property of each tag (see SampleTimeoutInS in 'Returns (JSON)' GET Tag section). If the samples obtained are older than the set Sample Timeout, the sample will not be excluded from the series (i.e. a null will not be returned)

When 'LastSamples' is requested, the sample timeout parameter is ignored. 'timestamp' parameter is not valid for this request.

Examples:
https://127.0.0.1:33170/api/tags/Random.Real4/samples?from=2019-08-16T03:43:05.432Z&to=2019-08-16T03:43:08.432Z 		//returns samples every 1 second (default)
https://127.0.0.1:33170/api/tags/Random.Real4/samples?from=2019-08-16T03:30:05.432Z&to=2019-08-16T03:43:08.432Z&interval=120000 //returns samples every 120 seconds
https://127.0.0.1:33170/api/tags/Random.Real4/samples?from=now-1m&to=now 							//returns samples every 1 second (default)
https://127.0.0.1:33170/api/tags/Random.Real4/samples?from=now-1m&to=now&interval=30000  					//returns samples every 30 seconds
Returns (JSON):
{
    "data": [
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:05.432",
            "TSUTC": "/Date(1565926985432)/",
            "TSUTC_ISO": "2019-08-16T03:43:05.432Z",
            "Value": 14333.69
        },
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:06.432",
            "TSUTC": "/Date(1565926986432)/",
            "TSUTC_ISO": "2019-08-16T03:43:06.432Z",
            "Value": 14333.69
        },
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:07.432",
            "TSUTC": "/Date(1565926987432)/",
            "TSUTC_ISO": "2019-08-16T03:43:07.432Z",
            "Value": 5937.775
        }
    ]
}
{
    "data": [        
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:12.432",
            "TSUTC": "/Date(1565926992432)/",
            "TSUTC_ISO": "2019-08-16T03:43:12.432Z",
            "Value": 41.968
        }
    ]
}
GET

Raw Sample(s)

This API gets a series/array of 'Raw Samples' for a 'TagId'. In Open-Plant Tag Ids are not case sensitive. A 'Sample' is akin to a data point, which has 'time stamp', 'value' and an 'Error' flag. 'Raw Samples' are samples taken directly from database without any interpolation or time series interval adjustment done to them, unlike the 'Sample(s) Series' API call above. 

NOTE: Generally, this API Call has better speed and performance.

Parameters 'from' and 'to' needs to be specified with a timestamp. The timetsamp needs to be in ISO formats such as 'YYYY-MM-dd hh:mm:ss.ttt' and in UTC. These parameters also accepts semantics such as 'now', 'now-1d', and etc as shown in 'Examples' below. If parameters 'from' and 'to'  are not specified, a '400 Bad Request' error will be shown. This API will return all raw samples from database between 'from' and 'to'. An 'interval' parameter can be set which limits the raw samples returned.  This 'interval' parameter is a value in miliseconds. It ensure that the raw samples are only obtained every 'interval'. In another word, there will exist a minimum 'interval' space between the returned raw samples.

The raw series output will ignore the set Sample Timeout, a property of each tag (see SampleTimeoutInS in 'Returns (JSON)' GET Tag section).

Examples:
https://127.0.0.1:33170/api/tags/Random.Real4/rawsamples?from=2019-08-16T03:43:05.432Z&to=2019-08-16T03:43:08.432Z 			//All samples are returned
https://127.0.0.1:33170/api/tags/Random.Real4/rawsamples?from=2019-08-16T03:30:05.432Z&to=2019-08-16T03:43:08.432Z&interval=120000 	//returns samples every 120 seconds
https://127.0.0.1:33170/api/tags/Random.Real4/rawsamples?from=now-1m&to=now 								//All samples are returned
https://127.0.0.1:33170/api/tags/Random.Real4/rawsamples?from=now-1m&to=now&interval=30000  						//returns samples every 30 seconds
Returns (JSON):
{
    "data": [
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:05.432Z",
            "TSUTC": "/Date(1565926985432)/",
            "TSUTC_ISO": "2019-08-16T03:43:05.432Z",
            "Value": 14333.69
        },
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:06.432Z",
            "TSUTC": "/Date(1565926986432)/",
            "TSUTC_ISO": "2019-08-16T03:43:06.432Z",
            "Value": 14333.69
        },
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:07.432Z",
            "TSUTC": "/Date(1565926987432)/",
            "TSUTC_ISO": "2019-08-16T03:43:07.432Z",
            "Value": 5937.775
        }
    ]
}
GET

Data Table

This API gets a table of values. Imagine a table, which has 'timestamps' aranged in the left hand side as rows and 'TagIds' aranged in the top as columns, as shown below:
The parameter 'TagIds' can be specified with one or more Tag Id, with commas(,) separating them. In Open-Plant Tag Ids are not case sensitive. Parameters 'from' and 'to' needs to be specified with a timestamp. The timetsamp needs to be in ISO formats such as 'YYYY-MM-dd hh:mm:ss.ttt' and in UTC. These parameters also accepts semantics such as 'now', 'now-1d', and etc as shown in 'Examples' below. If parameters 'from' and 'to'  are not specified, a '400 Bad Request' error will be shown. 

The table rows will contain timestamps every 1 second between 'from' and 'to'. This interval can be changed by specifying an optional 'interval' parameter which is a value in miliseconds. In the above table example, the 'interval' is 10000 (i.e. 10 seconds). The API returns three variation of the table rows corresponding to three different types of time stamps. 'TSUTCs' means time stamp is in UTC Format (displayed as UNIX timestamp). 'TSLocals' means time stamp is in local server time. '_ISO' means time stamp is formated to ECMA/ISO8601 format, convenient for Java Script code.

The table values will be output as a 'ValuesTable' object which contains an array 'Values', where each array can be thought as a row in the data table. The values will always honor the set Sample Timeout, a property of each tag (see SampleTimeoutInS in 'Returns (JSON)' GET Tag section). If the samples obtained are older than the set Sample Timeout, the sample will not be excluded from the series (i.e. a null will not be returned)


Examples:
https://127.0.0.1:33170/api/datatable?tagids=Random.Real4,Random.Int1&from=2019-08-16T03:43:05.432Z&to=2019-08-16T03:43:08.432Z 		//time stamps are at 1 seconds interval (default)
https://127.0.0.1:33170/api/datatable?tagids=Random.Real4,Random.Int1&from=2019-08-16T03:30:05.432Z&to=2019-08-16T03:43:08.432Z&interval=120000 //time stamps are at 120 seconds interval
https://127.0.0.1:33170/api/datatable?tagids=Random.Real4,Random.Int1&from=now-1m&to=now 							//time stamps are at 1 second interval (default)
https://127.0.0.1:33170/api/datatable?tagids=Random.Real4,Random.Int1&from=now-1m&to=now&interval=30000  					//time stamps are at 30 seconds interval
Returns (JSON):
{
    "data": {
        "TLocals_ISO": [		// This is the first variation of TimeStamp (The Table Rows)
            "2019-08-16T11:30:05.432",
            "2019-08-16T11:33:05.432",
            "2019-08-16T11:36:05.432",
            "2019-08-16T11:39:05.432",
            "2019-08-16T11:42:05.432"
        ],
        "TSUTCs": [			// This is the second variation of TimeStamp (The Table Rows)
            "/Date(1565926205432)/",
            "/Date(1565926385432)/",
            "/Date(1565926565432)/",
            "/Date(1565926745432)/",
            "/Date(1565926925432)/"
        ],
        "TSUTCs_ISO": [			// This is the third variation of TimeStamp (The Table Rows)
            "2019-08-16T03:30:05.432Z",
            "2019-08-16T03:33:05.432Z",
            "2019-08-16T03:36:05.432Z",
            "2019-08-16T03:39:05.432Z",
            "2019-08-16T03:42:05.432Z"
        ],
        "TagIds": [			// This is the TagId Table Columns
            "Random.Real4",
            "Random.Int1"
        ],
        "ValuesRows": [			// This is the Data Table Rows, each element is a Table Row
            [
            	10448.72,		// Corresponds to "Random.Real4" @ "2019-08-16T03:30:05.432Z"
                27122			// Corresponds to "Random.Int1"  @ "2019-08-16T03:30:05.432Z"
            ],
            [
                10448.72,		// Corresponds to "Random.Real4" @ "2019-08-16T03:33:05.432Z"
                27122			// Corresponds to "Random.Int1"  @ "2019-08-16T03:33:05.432Z"
            ],
            [
                10448.72,		// Corresponds to "Random.Real4" @ "2019-08-16T03:36:05.432Z"
                27122			// Corresponds to "Random.Int1"  @ "2019-08-16T03:36:05.432Z"
            ],
            [
                10448.72,		// Corresponds to "Random.Real4" @ "2019-08-16T03:39:05.432Z"
                27122			// Corresponds to "Random.Int1"  @ "2019-08-16T03:39:05.432Z"
            ],
            [
                21341.18,		// Corresponds to "Random.Real4" @ "2019-08-16T03:42:05.432Z"
                8			// Corresponds to "Random.Int1"  @ "2019-08-16T03:42:05.432Z"
            ]
        ]
    }
}

WRITE APIs

Write APIs are API which causes a change in the Open-Plant Database. If basic authentication is enabled, write APIs require the user's access level to be higher than the Web API minimum access level, set in the Open-Plant Client.
POST

Create Tag

This API allows the creation of a new Open-Plant Tag. if a tag already exists, the tag will be updated. In Open-Plant, the primary identifier for a tag is the 'TagId'. The TagId is a combination of two parameters, which is 'TagName' dot('.') 'Parameter'.  For example, TagName 'FIC101' and Parameter 'PV', will result in Tag Id 'FIC101.PV'. The API allows one to specify 'TagId' or 'TagName' and 'Parameter'.and  In Open-Plant ,'TagId', 'TagName' and 'Parameter' are not case sensitive. 

Other parameters are as below. All these other parameters are optional.
- 'unitofmeasure' is the engineering unit of the tag's value such as 'KG', 'DegC', 'N', 'M3HR'. This is important for display in charts.
- 'datatype' is the Data Type of the tag's value which can either be 'Real'(0),'Int'(1) or 'Bool'(2). Note: If datatype is not specified, the default is 'Real'
- 'interpolation' can either be 'Linear'(1) or 'Digital'(2). In 'Linear' interpolation, value is linear interpolated between two nearby raw samples. In 'Digital' interpolation, the last raw sample is taken. If interpolation is not specified, the default is 'Linear'
- 'description' is the Tag's description. This is important for display in GUI.
- 'corporate', 'plant', 'area', 'unit' are the physical locations of the tag in a typical plant hierarchy.
- 'p1','p2','p3'....'p9' are optional custom parameters.

The api will return the tag created in JSON if successful and a 'TagAlreadyExists' variable. This variable returns 'true', if the Tag to be created already exists in the system. Also to note, if a tag already exists, the tag will be updated based on the latest parameters provided.

Examples:
https://127.0.0.1:33170/api/tags/create?tagid=MyNewTag.pv
https://127.0.0.1:33170/api/tags/create?tagname=MyNewTag&parameter=pv				//this will create the same Tag as above
https://127.0.0.1:33170/api/tags/create?tagid=TIC1.pv&unitofmeasure=DegC&datatype=real&interpolation=linear
https://127.0.0.1:33170/api/tags/create?tagid=TIC1.pv&unitofmeasure=DegC			//this will create the same Tag as above. Default 'datatype' is real and default 'interpolation' is linear
https://127.0.0.1:33170/api/tags/create?tagid=FIC1.pv&unitofmeasure=M3HR&corporate=Open-Plant&plant=Refinery&area=Process&Unit=CDU
https://127.0.0.1:33170/api/tags/create?tagid=FIC2.pv&unitofmeasure=M3HR&corporate=Open-Plant&plant=Refinery&area=Process&Unit=CDU&p1=First Custom Stuff&p2=Custom Stuff&p3=Custom Stuff&p4=Custom Stuff&p5=Custom Stuff&p6=Custom Stuff&p7=Custom Stuff&p8=Custom Stuff&p9=Last Custom Stuff
Returns (JSON):
{
	"TagAlreadyExists": false,
    "data": {
        "Id": "TIC1.pv",
        "TagName": "TIC1",
        "Parameter": "pv",
        "UnitOfMeasure": "DegC",
        "Description": null,
        "Corporate": null,
        "Plant": null,
        "Area": null,
        "Unit": null,
        "Param1": "",
        "Param2": "",
        "Param3": "",
        "Param4": "",
        "Param5": "",
        "Param6": "",
        "Param7": "",
        "Param8": "",
        "Param9": "",
        "DataType": 0,
        "InterpType": 1,
        "SampleTimeoutInS": 180,
        "CacheSizeInNumberOfItems": 3600,
        "DuplicateThresholdInMS": 250,
        "DatabaseLocation": "pv_TIC1.pv",
        "LiveValue": null,
        "LastValue": null
    }
}
{
    "TagAlreadyExists": false,
    "data": {
        "Id": "FIC2.pv",
        "TagName": "FIC2",
        "Parameter": "pv",
        "UnitOfMeasure": "M3HR",
        "Description": null,
        "Corporate": "Open-Plant",
        "Plant": "Refinery",
        "Area": "Process",
        "Unit": "CDU",
        "Param1": "First Custom Stuff",
        "Param2": "Custom Stuff",
        "Param3": "Custom Stuff",
        "Param4": "Custom Stuff",
        "Param5": "Custom Stuff",
        "Param6": "Custom Stuff",
        "Param7": "Custom Stuff",
        "Param8": "Custom Stuff",
        "Param9": "Last Custom Stuff",
        "DataType": 0,
        "InterpType": 1,
        "SampleTimeoutInS": 180,
        "CacheSizeInNumberOfItems": 3600,
        "DuplicateThresholdInMS": 250,
        "DatabaseLocation": "pv_FIC2.pv",
        "LiveValue": null,
        "LastValue": null
    }
}
DELETE

Delete Tag

This API allows the deletion of an Open-Plant Tag. if the tag does not exist, an error '404-Not Found' will be thrown. In Open-Plant, the primary identifier for a tag is the 'TagId', which is not case sensitive. 

An optional parameter 'deletedatabase' when passed with 'true' or '1', will not only delete the tag, but also delete the tag value data as well. It is generally logical to set this as 'true' since the tag has been deleted, there is no need to keep it's value data as well. However, this provides a means to undelete any tags which may have been accidentally deleted. By default, this 'deletedatabase' parameter is set to 'false'.

The api will return the tag deleted in JSON if successful. 

Examples:
https://127.0.0.1:33170/api/tags/delete?tagid=fic1.pv
https://127.0.0.1:33170/api/tags/delete?tagid=fic1.pv&deletedatabase=true
https://127.0.0.1:33170/api/tags/delete?tagid=fic1.pv&deletedatabase=false
Returns (JSON):
{
    "data": {
        "Id": "FIC1.pv",
        "TagName": "FIC1",
        "Parameter": "pv",
        "UnitOfMeasure": "M3Hr",
        "Description": null,
        "Corporate": null,
        "Plant": null,
        "Area": null,
        "Unit": null,
        "Param1": "",
        "Param2": "",
        "Param3": "",
        "Param4": "",
        "Param5": "",
        "Param6": "",
        "Param7": "",
        "Param8": "",
        "Param9": "",
        "DataType": 0,
        "InterpType": 1,
        "SampleTimeoutInS": 180,
        "CacheSizeInNumberOfItems": 3600,
        "DuplicateThresholdInMS": 250,
        "DatabaseLocation": "pv_FIC1.pv",
        "LiveValue": null,
        "LastValue": null
    }
}
POST

Update Tag

This API allows the update of an existing Open-Plant Tag, identified by 'TagId'. In Open-Plant TagId is not case sensitive. if the tag does not exist, an error '404-Not Found' will be thrown.  

Theparameters that can be updated are as below.
- 'unitofmeasure' is the engineering unit of the tag's value such as 'KG', 'DegC', 'N', 'M3HR'. This is important for display in charts.
- 'datatype' is the Data Type of the tag's value which can either be 'Real'(0),'Int'(1) or 'Bool'(2). Note: If datatype is not specified, the default is 'Real'
- 'interpolation' can either be 'Linear'(1) or 'Digital'(2). In 'Linear' interpolation, value is linear interpolated between two nearby raw samples. In 'Digital' interpolation, the last raw sample is taken. If interpolation is not specified, the default is 'Linear'
- 'description' is the Tag's description. This is important for display in GUI.
- 'corporate', 'plant', 'area', 'unit' are the physical locations of the tag in a typical plant hierarchy.
- 'p1','p2','p3'....'p9' are optional custom parameters.

The api will return the updated tag as JSON object if successful.

Examples:
https://127.0.0.1:33170/api/tags/TIC1.pv/update?unitofmeasure=DegF
https://127.0.0.1:33170/api/tags/TIC1.pv/update?unitofmeasure=DegF&datatype=real&interpolation=digital
https://127.0.0.1:33170/api/tags/FIC1.pv/update?unitofmeasure=M3HR&corporate=Open-Plant&plant=Refinery&area=Process&Unit=CDU
https://127.0.0.1:33170/api/tags/FIC1.pv/update?unitofmeasure=M3HR&corporate=Open-Plant&plant=Refinery&area=Process&Unit=CDU&p1=First Custom Stuff&p2=Custom Stuff&p3=Custom Stuff&p4=Custom Stuff&p5=Custom Stuff&p6=Custom Stuff&p7=Custom Stuff&p8=Custom Stuff&p9=Last Custom Stuff
Returns (JSON):
{
    "data": {
        "Id": "TIC1.pv",
        "TagName": "TIC1",
        "Parameter": "pv",
        "UnitOfMeasure": "DegF",
        "Description": "",
        "Corporate": "",
        "Plant": "",
        "Area": "",
        "Unit": "",
        "Param1": "",
        "Param2": "",
        "Param3": "",
        "Param4": "",
        "Param5": "",
        "Param6": "",
        "Param7": "",
        "Param8": "",
        "Param9": "",
        "DataType": 0,
        "InterpType": 2,
        "SampleTimeoutInS": 180,
        "CacheSizeInNumberOfItems": 3600,
        "DuplicateThresholdInMS": 250,
        "DatabaseLocation": "pv_TIC1.pv",
        "LiveValue": null,
        "LastValue": {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T19:28:06.000",
            "TSUTC": "/Date(1565926086000+0800)/",
            "TSUTC_ISO": "2019-08-16T11:28:06.000Z",
            "Value": 22978.03
        }
    }
}
POST

Insert Sample

This API inserts a single data into a Tag, identified by a case insensitive 'TagId'. In Open-Plant, a single data is called a 'Sample', which has a 'time stamp', 'value' and an 'IsError' flag. Thus this APIs needs to be specified with the following:

- 'value' is the data to be inserted, which must be a numerical value. Depending on the 'datatype' property of the tag, value will be converted to 'Real'(0), 'Int'(1) or 'Bool'(2) accordingly. 

- 'timestamp' is the time of the sample data.  It should be specified in the standard ISO format of 'YYYY-MM-dd hh:mm:ss'. Such timestamp inserted must be in UTC format. The timestamp parameter also accepts semantics such as 'now', 'now-1d', and etc as shown in 'Examples' below. If timestamp is not specified, the system will set the timestamp to the current time.

- 'iserrors' is a flag which indicates the data is invalid. This parameter can be specified with either 'true','false','1' or '0'. When 'IsError' is set true, Open-Plant will ignore 'value' and will typically not display the value in charts. 'IsError' is generally used to mark a point of device error which can be used for reliability and maintenance analytics. If 'IsError' is not specified the system will default IsError to false.

The api will return the inserted sample JSON object if successful.

Examples
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23			//This assumes timestamp=now
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23&timestamp=2019-08-16 13:03:02
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23&timestamp=2019-08-16 03:43:22.033
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23&timestamp=2019-08-16T03:43:22.212Z
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23&timestamp=now
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23&timestamp=now-1d		//Get data 1 day ago.
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23&timestamp=now-10m		//Get data 10 minutes ago.
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23&timestamp=now-3h		//Get data 3 hours ago.
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=1.23&timestamp=now-5s		//Get data 5 seconds ago.
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=null&timestamp=2019-08-16T03:43:22.212Z&iserror=true
https://127.0.0.1:33170/api/tags/Random.Real4/insert?value=null&iserror=true
Returns (JSON):
{
    "data": {
        "IsError": false,
        "TSLocal_ISO": "2019-08-16T16:31:38.007",
        "TSUTC": "/Date(1565944298007)/",
        "TSUTC_ISO": "2019-08-16T08:31:38.007Z",
        "Value": null
    }
}
{
    "data": {
        "IsError": true,
        "TSLocal_ISO": "2019-08-18T07:11:01.444",
        "TSUTC": "/Date(1566083461444)/",
        "TSUTC_ISO": "2019-08-17T23:11:01.444Z",
        "Value":NaN
    }
}
POST

Insert Bulk Sample(s)

This API inserts many data into a single Tag, identified by a case insensitive 'TagId'. In Open-Plant, a data is called a 'Sample', which has a 'time stamp', 'value' and an 'IsError' flag. Thus this APIs needs to be specified with the following:

- 'values' is the set of data to be inserted, which must be a numerical value. Each value should be separated by a comma(,). Depending on the 'datatype' property of the tag, value will be converted to 'Real'(0), 'Int'(1) or 'Bool'(2) accordingly. The 'values' parameter is compulsory and must be provided. If not, a '400-Bad Request' error will be thrown.

- 'timestamps' is the set of timestamps corresponding to the 'values' data.  It should be specified in the standard ISO format of 'YYYY-MM-dd hh:mm:ss' and in UTC format. The timestamp parameter also accepts semantics such as 'now', 'now-1d', and etc as shown in 'Examples' below. Each timestamp should be separated by a comma(,) and the number of elements must be the same as 'values'. The 'timestamps' parameter is compulsory and must be provided. If not, a '400-Bad Request' error will be thrown. 

- 'iserrors' is a set of flags which indicates the validity of the corresponding 'values' data is invalid. This parameter can be specified with either 'true','false','1' or '0'. Each iserror flag should be separated by a comma(,) and the number of elements must be the same as 'values'. When 'IsError' is set true, Open-Plant will ignore the corresponding 'value' and will typically not display the value in charts. 'IsError' is generally used to mark a point of device error which can be used for reliability and maintenance analytics. The API also accepts a single 'IsErrors' value supplied, which if this be the case will render the entire set of values iserror 'true' or 'false' accordingly.

The api will return the inserted samples JSON object if successful.

Examples:
https://127.0.0.1:33170/api/tags/Random.Real4/insertbulk?values=0.1,0.2,0.15&timestamps=now,now-1s,now-2s
https://127.0.0.1:33170/api/tags/Random.Real4/insertbulk?values=1.23,1.24,1.30&timestamps=2019-08-16 13:03:02,2019-08-16 13:04:02,2019-08-16 13:05:02
https://127.0.0.1:33170/api/tags/Random.Real4/insertbulk?values=1,2,3&timestamps=2019-08-16T03:43:20.212Z,2019-08-16T03:43:21.212Z,2019-08-16T03:43:22.212Z
https://127.0.0.1:33170/api/tags/Random.Real4/insertbulk?values=0.1,0.2,0.15&timestamps=now,now-1s,now-2s&iserrors=0,1,0
https://127.0.0.1:33170/api/tags/Random.Real4/insertbulk?values=0.1,0.2,0.15&timestamps=now,now-1s,now-2s&iserrors=0
https://127.0.0.1:33170/api/tags/Random.Real4/insertbulk?values=0.1,0.2,0.15&timestamps=now,now-1s,now-2s&iserrors=false
Returns (JSON):
{
    "data": [
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:20.212",
            "TSUTC": "/Date(1565927000212)/",
            "TSUTC_ISO": "2019-08-16T03:43:20.212Z",
            "Value": 1
        },
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:21.212",
            "TSUTC": "/Date(1565927001212)/",
            "TSUTC_ISO": "2019-08-16T03:43:21.212Z",
            "Value": 2
        },
        {
            "IsError": false,
            "TSLocal_ISO": "2019-08-16T11:43:22.212",
            "TSUTC": "/Date(1565927002212)/",
            "TSUTC_ISO": "2019-08-16T03:43:22.212Z",
            "Value": 3
        }
    ]
}
POST

Insert Multiple

This API inserts many data into many Tags, unlike the previous APIs which inserts many data into a single tag. In Open-Plant, a data is called a 'Sample', which has a 'time stamp', 'value' and an 'IsError' flag. Thus this APIs needs to be specified with the following:

- 'tagids' is the set of tags where the samples are to be inserted. Each value should be separated by a comma(,). While inserting, if a Tag does not exists, the tag will be created. The 'tagids' parameter is compulsory and must be provided. If not, a '400-Bad Request' error will be thrown. The API also accepts a single tagid value supplied, which if this be the case will render the entire set of samples to be inserted to the same tag.
 
- 'values' is the set of data to be inserted, which must be numerical values. Each value should be separated by a comma(,) and it's position in the comma separated string will correspond to the tagids. Depending on the 'datatype' property of the tag, value will be converted to 'Real'(0), 'Int'(1) or 'Bool'(2) accordingly. The 'values' parameter is compulsory and must be provided. If not, a '400-Bad Request' error will be thrown.

- 'timestamps' is the set of timestamps corresponding to the 'values' data.  It should be specified in the standard ISO format of 'YYYY-MM-dd hh:mm:ss' and in UTC format. The timestamp parameter also accepts semantics such as 'now', 'now-1d', and etc as shown in 'Examples' below. Each timestamp should be separated by a comma(,) and the number of elements must be the same as 'values'. If the 'timestamps' parameter not provided, it will assume all timestamps as 'now' or current time. This API also accepts a single 'timestamps' value supplied, which if this be the case will render the entire set of values timestamps to be inserted the same. This may be typically be used for example when inserting the more recent data of multiple tags.

- 'iserrors' is a set of flags which indicates the validity of the corresponding 'values' data is invalid. This parameter can be specified with either 'true','false','1' or '0'. Each iserror flag should be separated by a comma(,) and the number of elements must be the same as 'values'. When 'IsError' is set true, Open-Plant will ignore the corresponding 'value' and will typically not display the value in charts. 'IsError' is generally used to mark a point of device error which can be used for reliability and maintenance analytics. The API also accepts a single 'IsErrors' value supplied, which if this be the case will render the entire set of values iserror 'true' or 'false' accordingly.

- 'datatypes' is a set of DataType definition which corresponds to the 'values' data. This parameter is used only when a new tag is created during the insert process. DataType can either be 'Real'(0), 'Int'(1) or 'Bool'(2). Each value should be separated by a comma(,) and it's position in the comma separated string will correspond to the tagids. The 'datatypes' parameter is NOT required. If it is not provided, it will use the Tags data type, when inserting a new data, or  assume the data type as 'Real' when creating a new tag.

The api will return the number of samples inserted and tags created.

Examples:
https://127.0.0.1:33170/api/insertbulk?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15&timestamps=2019-08-16T03:43:20.212Z,2019-08-16T03:43:21.212Z,2019-08-16T03:43:22.212Z
https://127.0.0.1:33170/api/insertbulk?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15&timestamps=now,now-1s,now-2s
https://127.0.0.1:33170/api/insertbulk?tagids=random.int1,fic1.pv&values=3,2&timestamps=now,now&datatypes=int,real
https://127.0.0.1:33170/api/insertbulk?tagids=random.int1,fic1.pv&values=3,2&datatypes=int,real&iserrors=true,false
https://127.0.0.1:33170/api/insertbulk?tagids=random.int1,fic1.pv&values=3,2&datatypes=int,real&iserrors=true				//this causes all samples inserted have iserror=true
https://127.0.0.1:33170/api/insertbulk?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15					//this inserts all 3 samples at current time
https://127.0.0.1:33170/api/insertbulk?tagids=fic1.pv&values=0.1,2,0.15&timestamps=now,now-1s,now-2s					//this inserts all 3 samples into 'fic1.pv'
https://127.0.0.1:33170/api/insertbulk?tagids=random.real4,random.int1,fic1.pv&values=0.1,2,0.15&timestamps=2019-08-16T03:43:20.212Z	//this inserts all 3 samples at '2019-08-16T03:43:20.212Z'
Returns (JSON):
{
    "totalsamplesinserted": 3,
    "totaltagscreated": 0
}
Open-Plant is a revolutionary Industrial IOT Platform software, used to create and deploy Industrial IT apps/solutions. It is an all-encompassing solution offering both back-end and front-end components i.e. the full stack. From our user's experience, creating and deploying Industrial IT apps became 10x faster and 10x less cost. We serve the mining, energy, oil & gas, construction and manufacturing industry. 

OPEN-PLANT PTY LTD

Perth, Australia

EMAIL

info@open-plant.com
homedownloadenvelope