Rockwell Automation Plex APM OData API
Tag Data Endpoint You can use this to query the data points(numerical tags data) and events(boolean and string tags data) from Plex APM. In order to query the data, currently, only $filter, $select and $top query parameters are supported. How to use the API: Parameter $filter query is required. Parameter $filter query must always have StartDateTime and EndDateTime. For $filter query, allowed logical operators are: eq/and/in/startswith/endswith. All query parameters are case-sensitive. All query paramters should be provided in complete length with eq or in logical operators. A partial match won't be returned in the response. Startswith, Endswith operator currently support only AssetCode, AssetName, TagName and TagAlias for partial text search or wildcard search. The response will always have StartDateTime and EndDateTime query parameters returned with null value hence this can be ignored. The actual timestamp of the record is indicated by ReceivedISOTimestamp in the response. For $filter query, start date cannot be before 2019-01-01T00:00:00Z. Parameter $top query is optional with max limit of 50000. Parameter $orderBy is not supported. Parameter $filter date range defined by StartDateTime and EndDateTime must not exceed 31 days. Query Options Following are sample OData parameters queries (Query options overview - OData | Microsoft Docs) $select: For retrieving specific columns in the response, you should provide $select parameter. Following are the acceptable values for select query: AssetCode AssetName TagName TagAlias DataType StreamType Value MeasuringUnit Quality ReceivedISOTimestamp Severity EventReason Source GatewayName GatewayId StartDateTime EndDateTime $top: For limiting response to a specific record count, you should provide $top parameter. If user does not provide $top parameter, response will be served with a default limit of 50000. $top accepts a non-negative integer value. $filter: For fetching the tag data, you must provide $filter parameter. Allowed logical operators for filter query are - eq, and, in, startswith, endswith. Following list describes allowed $filter query parameters, along with their acceptable values/format: StartDateTime: Start datetime for the filter query is mandatory.Valid format: YYYY-MM-DDThh:mm:ssZ. EndDateTime: End datetime for the filter query is mandatory.Valid format: YYYY-MM-DDThh:mm:ssZ. AssetCode: Single or comma-separated list of asset codes using eq or in or startswith or endswith respectively, for which response is retrieved. This parameter is case-sensitive and requires the complete asset code for matching using eq or in. For partial text search, use startswith or endswith. AssetName: Single or comma-separated list of asset names using eq or in or startswith or endswith respectively, for which response is retrieved. This parameter is case-sensitive and requires the complete asset name for matching using eq or in. For partial text search, use startswith or endswith. TagName: Single or comma-separated list of tag names using eq or in or startswith or endswith respectively, for which response is retrieved. This parameter is case-sensitive and requires the complete tag name for matching using eq or in. For partial text search, use startswith or endswith. TagAlias: Single or comma-separated list of tag alias using eq or in or startswith or endswith respectively, for which response is retrieved. This parameter is case-sensitive and requires the complete tag alias for matching using eq or in.For partial text search, use startswith or endswith. DataType: Single or comma-separated list of data types using eq or in or startswith or endswith respectively, for which response is retrieved.This parameter is case-sensitive and requires the complete data type for matching. Following are the allowed values for data type: Numerical, Boolean, String. StreamType: Single or comma-separated list of stream types using eq or in or startswith or endswith respectively, for which response is retrieved. Stream type values are case-sensitive and requires the complete stream type for matching. Following are the allowed values for stream type: Boolean: Problem, Abnormal, Action Required, Maintenance, In-Cycle, Idle, Off, Other and any user-defined Boolean stream types. Numerical: Threshold, Discreet, Continuous. String: Part Number, Batch Number, Job Number, Operation Code, Operation Number, Other, Lot Number, Process Code, Tool Number` and any user-defined string stream types. MeasuringUnit: Single or comma-separated list of unit abbreviation using eq or in respectively, for which response is retrieved. This parameter is case-sensitive and requires the complete unit abbreviation for matching. Source: Single or comma-separated list of sources using eq or in or startswith or endswith respectively. A source in Plex APM could be a gateway name, 'Complex Event Processor' for threshold events, or a system-defined source for user actions. This parameter is case-sensitive and requires the complete source name for matching. GatewayName: Single or comma-separated list of gateway name using eq or in or startswith or endswith respectively, for which response is retrieved. This parameter is case-sensitive and requires the complete gateway name for matching. GatewayId: Single or comma-separated list of gateway ID using eq or in or startswith or endswith respectively, for which response is retrieved. This parameter is case-sensitive and requires the complete gateway ID for matching. Following are examples of filter, select, and top query that combine logical operator and query parameters. $filter=startdatetime eq 2021-07-12T00:00:00Z and enddatetime eq 2021-07-12T07:01:55Z $filter=startdatetime eq 2021-07-12T00:00:00Z and enddatetime eq 2021-07-12T07:01:55Z and source in ('GatewayName1', 'GatewayName2') and assetcode eq 'AssetCode1' and assetname in ('AssetName1') $filter=startdatetime eq 2021-07-12T00:00:00Z and enddatetime eq 2021-07-12T07:01:55Z and assetcode in ('AssetCode1', 'AssetCode2') and tagName in ('TagName1', 'TagName2')&$select=TagName, AssetCode, AssetName, GatewayName, Value,ReceivedISOTimestamp&$top=10 $filter=startdatetime eq 2021-07-12T00:00:00Z and enddatetime eq 2021-07-12T07:01:55Z and startswith(tagname,'Ex') and endswith(tagname,'Bool') $filter=startdatetime eq 2021-07-12T00:00:00Z and enddatetime eq 2021-07-12T07:01:55Z and startswith(tagalias,'Ex') and endswith(tagalias,'Bool') and assetname eq 'Broach-06' and MeasuringUnit eq 'kA'