Query channels
| /cm/channels/query Query for channel TIDs |
POST /cm/channels/query
Resource path |
/api/core/v1/cm/channels/query |
HTTP method |
POST |
Request content type |
application/json |
Response content type |
application/json |
Description
Query for channel tids hierarchically by providing a parent channel. Options to limit the depth of children returned or query all root channels without a parent.
Body Parameter
Specified by ChannelQueryDto
Return Type
Specified by ChannelRequest (only tids are filled in the response)
Responses
| Code | Message | Datatype |
|---|---|---|
200 |
channel found |
|
401 |
Not authorized |
<<>> |
404 |
Not found |
<<>> |
500 |
Server error |
<<>> |
Samples
Query Channels by tid or id
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/cm/channels/query' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"id": 598800
}'
Request body. By id (includes children by default)
{
"id": 598800
}
Request body. By tid (includes children by default)
{
"tid": "AWS"
}
Request body. By id with level (limit children returned to 2 levels down in the hierarchy)
{
"id": 598800,
"level": 2
}
Request body. By id with level (exclude children by setting level to 0)
{
"id": 598800,
"level": 0
}
Response body. Channel tids with children
{
"tids": [
"Print",
"FS2021",
"Sample Catalog",
"Document FS21-01_01",
"Document FS21-01_02",
"Document FS21-01_03",
"Document FS21-01_04"
]
}
Response body. Channel tid without children
{
"tids": [
"Print"
]
}
Response body. Error response, requested channel not found by id
{
"details": {
"itm": [
{
"key": "supportId",
"value": "4d28646b-b4f6-421f-9a46-f285cd7fd680"
}
]
},
"issues": [
{
"itm": [
{
"key": "code",
"value": "1000"
},
{
"key": "description",
"value": "An unknown internal error occurred"
}
],
"itms": [
{
"itm": [
{
"key": "errorMessage",
"value": "project by id 383010 not found"
}
],
"type": "details"
}
]
}
],
"status": "ERROR"
}
Query Channels, all root level channels without parent
curl
curl --location --request POST 'https://<OMN_SERVER>/api/core/v1/cm/channels/query' \
--header 'Authorization: Bearer <TOKEN>' \
--header 'Content-Type: application/json' \
--data-raw '{
"root": true
}'
Request body. Root level channels (all other parameters are ignored)
{
"root": true
}
Response body. Root level channels
{
"tids": [
"Print",
"Shootings1"
]
}
Response body. No root channels available
{
"tids": []
}