Tags Endpoints (2022/06)
This endpoint allows you to retrieve data about tags on the network.
Tag names, as well as all other entity properties, are case-insensitive (but values can only differ by case). The server may return entity properties and tag keys with a different case than specified by the client in the request.
Base URL for these endpoints: https://api.bsn.cloud/2022/06/REST/Tags
_________________________________________________________________________
GET /Keys/
Returns all tag names defined on a network that match a specified pattern.
Required Scope Token
bsn.api.main.tags.retrieve
______________________________________________________________
Query String Parameter
- pattern string optional: Enter a value in this format "{DataType}::[[sys].][{ObjectType}].<{TagKey}>". If this value is not entered, this will return all tags for all values. See the definitions below for further guidance:
- DataType is one of the supported data types. These supported data types are boolean, numeric, string, DateTime, TimeSpan, numeric array, and string array, as described on this page (but object is not supported). This value is optional.
- sys lets you distinguish system tag (defined by system) or custom tag (defined by customer). This value is optional.
- ObjectType is either Content or Device
- TagKey can be skipped, or partially specified with a wildcard character like * or ?, which will give you all of the tag keys matching this expression.
Note that /Tag/Keys/ is unique in the scope of entities in that some of the values can be skipped or partially defined. For example, [Content].<M?dia> is a valid entry.
______________________________________________________________
Request Example
The example request parameters and headers are set as follows:
- pattern is set to [Content].*
GET /2022/06/REST/Tags/Keys/?pattern=%5BContent%5D.* HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
Accept: application/json, application/vnd.bsn.error+json
Accept-Encoding: gzip,deflate______________________________________________________________
Success Response with Body
200: Returns all tag names defined on a network that match the pattern
Example
[
"String::[sys].[Content].<ContentType>",
"DateTime::[sys].[Content].<FileLastModifiedDate>",
"String::[sys].[Content].<FileName>",
"Number::[sys].[Content].<FileSize>",
"Number::[sys].[Content].<Id>",
"String::[Content].<JaneDoe>",
"String::[sys].[Content].<PhysicalPath>",
"String::[sys].[Content].<ThumbPath>",
"DateTime::[sys].[Content].<UploadDate>",
"String::[sys].[Content].<VirtualPath>"
]Failure Response
300: The requested representation could not be returned because it is ambiguous (there are multiple requested representations)
400: The request is malformed and therefore invalid
401: The access token is invalid or not specified
403: The supplied access token, though valid, doesn't provide access to this method
406: The server cannot return the data representation that you requested (as specified in the "Accept" header)
5XX: Any 500 code is an internal server error
GET /Values/
Returns all tag values defined on a network that match a specified pattern
Required Scope Token
bsn.api.main.tags.retrieve
______________________________________________________________
Query String Parameter
- pattern string optional: Enter a value in this format "{DataType}::[[sys].][{ObjectType}].<{TagValues}>". If this value is not entered, this will return all tags for all values. See the definitions below for further guidance:
- DataType is one of the supported data types. These supported data types are boolean, numeric, string, DateTime, TimeSpan, numeric array, and string array, as described in this page (but object is not supported). This value is optional.
- sys lets you distinguish system tag (defined by system) or custom tag (defined by customer). This value is optional.
- ObjectType is either Content or Device
- TagValues can be skipped, or partially specified with a wildcard character like * or ?, which will give you all of the tag values matching this expression.
Note that /Tag/Values/ is unique in the scope of entities in that some of the values can be skipped or partially defined. For example, [Content].<M?dia> is a valid entry.
______________________________________________________________
Request Example
The example request parameters and headers are set as follows:
- pattern is set to [sys].[Content].*
GET /2022/06/REST/Tags/Values/?pattern=%5Bsys%5D.%5BContent%5D.* HTTP/1.1
Host: api.bsn.cloud
Connection: Keep-Alive
Authorization: Bearer {{UserAccessToken}}
Accept: application/json, application/vnd.bsn.error+json
Accept-Encoding: gzip,deflate______________________________________________________________
Success Response with Body
200: Returns all tag values defined on a network that match the pattern
Example
[
"",
"Outside",
"2024-01-01 00:00:00Z",
12345
]Failure Response
300: The requested representation could not be returned because it is ambiguous (there are multiple requested representations)
400: The request is malformed and therefore invalid
401: The access token is invalid or not specified
403: The supplied access token, though valid, doesn't provide access to this method
406: The server cannot return the data representation that you requested (as specified in the "Accept" header)
5XX: Any 500 code is an internal server error