GET-Get Channel List
Introduces the interface call method for the Get Channel List interface.
Interface Introduction
The Get Channel List interface is used to retrieve the channel type.
After obtaining the list of channel types, you can subsequently use the Get Channel Detail Information interface to query the detailed information of a specific channel type. For more details, refer to Get Channel Detail Information.
Request method
GET
URL
Request Parameters
Parameter Name | Parameter Location | Required | Description |
---|---|---|---|
authorization | header | Yes | Authentication information in the request. See the section for details Authentication. |
x-skg-timestamp | header | Yes | Current Timestamp. See the section for details Authentication. |
Request URL
https://<ucwi_endpoint>:5443/skg/v1/dlp/channel
Request Example
Call the interface according to the following example to request channel information.
GET /skg/v1/dlp/channel/
Python Request Example
Use the following example to call the interface using Python code to request channel information.
Note: In the following Python code example, the imported header files ucwi_config and ucwi_auth need to be created beforehand. For detailed reference examples, see Header File Examples.
from requests.packages.urllib3.exceptions import InsecureRequestWarning from ucwi_config import UCWIConfig from ucwi_auth import get_headers import requests import json requests.packages.urllib3.disable_warnings(InsecureRequestWarning) api = "/skg/v1/dlp/channel" url = "{0}{1}".format(UCWIConfig.base_url, api) headers = get_headers() response = requests.get(url, headers=headers, verify=False) if response.status_code != 200: print("Bad request, response code:", response.status_code) print(response.text) else: print(json.dumps(response.json(), indent=4).encode('utf-8').decode('raw_unicode_escape'))
Return Results
Upon successful invocation of this interface, the system will return the following parameters.
Parameter | Description |
---|---|
channels | List displaying all currently connected channels |
channels.name | Channel Name:
|
channels.description | Channel Description - Custom description information for this channel |
Return Example
{ "channels": [{ "name": "web", "description": "Web channel" }, { "name": "email", "description": "Email channel" }, { "name": "webserviceapp", "description": "WebService Application channel" }] }
Error code
If calling the API has an error, the following error codes are returned:
Error Code | Description |
---|---|
400 | Invalid parameter |
404 | Unknown Error |
500 | Invalid parameter |