---
title: Tags Endpoints (2022/06)
slug: develop/tags-endpoints-202206
docTags: 
createdAt: 2025-03-11T07:03:30.743Z
---

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` <font color="#704ae0">string</font> <font color="#01a0af">optional: </font>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](docId:3L0afyD3xoOE-yTvfk2vs) (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.

:::hint{type="info"}
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].*`

```text
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**

<font color="#089a4d">200</font>: Returns all tag names defined on a network that match the `pattern`

**Example**

```json
[
   "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**

<font color="#9a0808">300</font>: The requested representation could not be returned because it is ambiguous (there are multiple requested representations)

<font color="#9a0808">400</font>: The request is malformed and therefore invalid

<font color="#9a0808">401</font>: The access token is invalid or not specified

<font color="#9a0808">403</font>: The supplied access token, though valid, doesn't provide access to this method 

<font color="#9a0808">406</font>: The server cannot return the data representation that you requested (as specified in the "Accept" header)

<font color="#9a0808">5XX</font>: 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` <font color="#704ae0">string</font> <font color="#01a0af">optional: </font>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](docId:3L0afyD3xoOE-yTvfk2vs) (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.

:::hint{type="info"}
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].*`

```text
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**

<font color="#089a4d">200</font>: Returns all tag values defined on a network that match the `pattern`

**Example**

```json
[
   "",
   "Outside",
   "2024-01-01 00:00:00Z",
   12345
]
```

**Failure Response**

<font color="#9a0808">300</font>: The requested representation could not be returned because it is ambiguous (there are multiple requested representations)

<font color="#9a0808">400</font>: The request is malformed and therefore invalid

<font color="#9a0808">401</font>: The access token is invalid or not specified

<font color="#9a0808">403</font>: The supplied access token, though valid, doesn't provide access to this method 

<font color="#9a0808">406</font>: The server cannot return the data representation that you requested (as specified in the "Accept" header)

<font color="#9a0808">5XX</font>: Any 500 code is an internal server error
