Query channel instance list¶
Lists channel instances in the current workspace by Provider.
GET https://moi.matrixorigin.cn/newmoi/workspaces/{workspace_id}/channels/{provider}/instances
Before you call¶
Prepare a personal access token with access to the target workspace, the target workspace ID, and the channel provider ID.
The example below uses:
$AI_STUDIO_API_KEY: The actual personal access token, passed through theX-API-KeyHeader.$WORKSPACE_ID: The workspace ID to be queried, passed through theX-Workspace-IDHeader, and asworkspace_idin the path.$PROVIDER: Channel Provider ID, asproviderin the path.
Request example¶
curl "https://moi.matrixorigin.cn/newmoi/workspaces/$WORKSPACE_ID/channels/$PROVIDER/instances?limit=20&offset=0" \
-H "X-API-Key: $AI_STUDIO_API_KEY" \
-H "X-Workspace-ID: $WORKSPACE_ID"
Path parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
Yes |
Workspace ID. |
|
string |
Yes |
Channel Provider ID. |
Query parameters¶
Parameters |
Type |
Is it required |
Description |
|---|---|---|---|
|
string |
No |
Filter by instance status. |
|
integer |
No |
Return quantity; default |
|
integer |
No |
Returns the starting position of the list; negative numbers are treated as |
Successful response¶
Returns 200 on success. No plaintext keys are returned for each item.
{
"code": 0,
"data": {
"items": [
{
"id": "inst_01",
"workspace_id": "ws_01",
"provider": "wecom",
"channel_type": "wecom_mail",
"name": "告警通道",
"status": "active",
"credential_ref": "cred_01"
}
],
"total": 1,
"limit": 20,
"offset": 0
}
}
The response fields are as follows.
Field |
Type |
Description |
|---|---|---|
|
integer |
|
|
array |
Channel instance of the current page. |
|
string |
Instance ID and workspace. |
|
string |
Instance ID and workspace. |
|
string |
Provider, channel type, and current status. |
|
string |
Provider, channel type, and current status. |
|
string |
Provider, channel type and current status. |
|
string |
Credential reference, not clear text key. |
|
string |
Callback path, capabilities, and associated tools; returned when available. |
|
string[] |
Callback path, capabilities, and associated tools; returned when available. |
|
string[] |
Callback path, capabilities, and associated tools; returned when available. |
|
string |
Recent test information; may not be returned if it has not been tested yet. |
|
string |
Most recent test information; may not be returned when no test has been run. |
|
string |
Recent test information; may not be returned if it has not been tested yet. |
|
integer |
The total number of matches, the size of this page and the starting offset. |
|
integer |
The total number of matches, the size of this page and the starting offset. |
|
integer |
The total number of matches, the size of this page and the starting offset. |
[] after a type denotes an array. [] in a field path denotes each item in an array.
Error response¶
{
"code": 2,
"message": "<错误信息>"
}
Common HTTP errors¶
HTTP status code |
error code |
Common causes |
Recommended actions |
|---|---|---|---|
|
|
Invalid provider, state, or paging parameters. |
Check path and query parameters. |
|
|
Lack of valid identity credentials. |
Check API Key. |
|
|
The current identity does not have permission to read the channel instance. |
Check workspace authorization. |
|
|
Channel instance services or authorization dependencies are temporarily unavailable. |
Try again later. |
Follow-up operations¶
Use the instance’s id Query channel instance details.