Test Feishu Connection
Headers
Authorization: OAuth the-session-uuidBody
{
"params": {
"url": "https://open.feishu.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81",
"atAll": true,
"atPersonUserIds": [
"13062689903",
"13062689901"
],
"secret": "fiSmveXkeD2jIjrENHYjQd",
"testMsg": "hello world",
"endpointUuid": "1c201c27a81740ddadbc5d2f3f38a5e4"
},
"systemTags": [],
"userTags": []
}In the preceding example, the systemTags and userTags fields are optional. They are listed to indicate that the body can contain these two fields.
Curl Example
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"url":"https://open.feishu.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81","atAll":true,"atPersonUserIds":["13062689903","13062689901"],"secret":"fiSmveXkeD2jIjrENHYjQd","testMsg":"hello world","endpointUuid":"1c201c27a81740ddadbc5d2f3f38a5e4"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/feishu/test-connectionParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| testMsg | String | body (Contained in the params structure) | Test message | 4.2.0 | |
| endpointUuid (Optional) | String | body (Contained in the params structure) | Feishu endpoint UUID | 4.2.0 | |
| systemTags (Optional) | List | body | System tags | 4.2.0 | |
| userTags (Optional) | List | body | User tags | 4.2.0 | |
| url (Optional) | String | body (Contained in the params structure) | webhook url | 4.2.0 | |
| atAll (Optional) | Boolean | body (Contained in the params structure) | @ all members | 4.2.0 | |
| atPersonUserIds (Optional) | List | body (Contained in the params structure) | @ user IDs | 4.2.0 | |
| secret (Optional) | String | body (Contained in the params structure) | Feishu secret | 4.2.0 |
API Response
Response example
{
"connected": true,
"webhookResp": {}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 4.2.0 | |
| connected | boolean | Webhook URL connectivity indicator (only indicates whether the connection can be established) | 4.2.0 |
| webhookResp | webhookResp | Feishu response message (https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot#e2f7069c) | 4.2.0 |
| error | ErrorCode | Error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error | 4.2.0 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code number, a globally unique identifier for the error, for example, SYS.1000 or HOST.1001 | 5.0.0 |
| description | String | A brief description of the error | 5.0.0 |
| details | String | Detailed information about the error | 5.0.0 |
| elaboration | String | Reserved field. Defaults to null | 5.0.0 |
| opaque | LinkedHashMap | Reserved field. Defaults to null | 5.0.0 |
| cause | ErrorCode | The root error that caused the current error. This field is null if there is no root cause | 5.0.0 |
SDK Examples
Java SDK
SNSFeiShuTestConnectionAction action = new SNSFeiShuTestConnectionAction();
action.url = "https://open.feishu.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81";
action.atAll = true;
action.atPersonUserIds = asList("13062689903","13062689901");
action.secret = "fiSmveXkeD2jIjrENHYjQd";
action.testMsg = "hello world";
action.endpointUuid = "1c201c27a81740ddadbc5d2f3f38a5e4";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SNSFeiShuTestConnectionAction.Result res = action.call();Python SDK
SNSFeiShuTestConnectionAction action = SNSFeiShuTestConnectionAction()
action.url = "https://open.feishu.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81"
action.atAll = true
action.atPersonUserIds = [13062689903, 13062689901]
action.secret = "fiSmveXkeD2jIjrENHYjQd"
action.testMsg = "hello world"
action.endpointUuid = "1c201c27a81740ddadbc5d2f3f38a5e4"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SNSFeiShuTestConnectionAction.Result res = action.call()