Test Feishu Connection

POST/zstack/v1/sns/application-endpoints/feishu/test-connection

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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-connection

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
testMsgStringbody (Contained in the params structure)Test message 4.2.0
endpointUuid (Optional)Stringbody (Contained in the params structure)Feishu endpoint UUID 4.2.0
systemTags (Optional)ListbodySystem tags 4.2.0
userTags (Optional)ListbodyUser tags 4.2.0
url (Optional)Stringbody (Contained in the params structure)webhook url 4.2.0
atAll (Optional)Booleanbody (Contained in the params structure)@ all members 4.2.0
atPersonUserIds (Optional)Listbody (Contained in the params structure)@ user IDs 4.2.0
secret (Optional)Stringbody (Contained in the params structure)Feishu secret 4.2.0

API Response

Response example

{
  "connected": true,
  "webhookResp": {}
}
NameTypeDescriptionStarting Version
successboolean 4.2.0
connectedbooleanWebhook URL connectivity indicator (only indicates whether the connection can be established)4.2.0
webhookRespwebhookRespFeishu response message (https://open.feishu.cn/document/client-docs/bot-v3/add-custom-bot#e2f7069c)4.2.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error4.2.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, for example, SYS.1000 or HOST.10015.0.0
descriptionStringA brief description of the error5.0.0
detailsStringDetailed information about the error5.0.0
elaborationStringReserved field. Defaults to null5.0.0
opaqueLinkedHashMapReserved field. Defaults to null5.0.0
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause5.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()