Create Feishu Endpoint

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=f8b9014a-207a-44d5-ae26-3501bf01dbc4",
    "atAll": false,
    "atPersonUserIds": [
      "18900002222",
      "13377778888"
    ],
    "secret": "DPKfmrIhYXY5M2TWGXy0ed",
    "atPersonList": {
      "13377778888": "jack"
    },
    "name": "feishu"
  },
  "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://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=f8b9014a-207a-44d5-ae26-3501bf01dbc4","atAll":false,"atPersonUserIds":["18900002222","13377778888"],"secret":"DPKfmrIhYXY5M2TWGXy0ed","atPersonList":{"13377778888":"jack"},"name":"feishu"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/feishu

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
urlStringbody (Contained in the params structure)Feishu bot Webhook URL 4.2.0
atAll (Optional)Booleanbody (Contained in the params structure)Whether to @ all members 4.2.0
atPersonUserIds (Optional)Listbody (Contained in the params structure)@ user IDs 4.2.0
nameStringbody (Contained in the params structure)Resource name 4.2.0
description (Optional)Stringbody (Contained in the params structure)Detailed description of the resource 4.2.0
platformUuid (Optional)Stringbody (Contained in the params structure)Notification platform UUID 4.2.0
resourceUuid (Optional)Stringbody (Contained in the params structure)Resource UUID 4.2.0
tagUuids (Optional)Listbody (Contained in the params structure)Tag UUID list 4.2.0
systemTags (Optional)ListbodySystem tags 4.2.0
userTags (Optional)ListbodyUser tags 4.2.0
secret (Optional)Stringbody (Contained in the params structure)Feishu secret 4.2.0
atPersonList (Optional)Mapbody (Contained in the params structure)@ user information (recommended) 4.2.0

API Response

Response example

{
  "inventory": {
    "url": "http://feishu-url",
    "atAll": false,
    "name": "example",
    "uuid": "917fe66f76b241f0843dfbd6be685fc1",
    "description": "description example",
    "type": "Email",
    "state": "Enabled",
    "platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
    "createDate": "Mar 26, 2024 2:44:26 AM",
    "lastOpDate": "Mar 26, 2024 2:44:26 AM"
  }
}
NameTypeDescriptionStarting Version
successboolean 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
inventorySNSFeiShuEndpointInventoryFor details, see inventory4.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

inventory

NameTypeDescriptionStarting Version
urlStringFeishu bot URL4.2.0
atAllboolean@ all members4.2.0
atPersonUserIdsList@ user IDs4.2.0
secretStringFeishu secret4.2.0
nameStringResource name4.2.0
uuidStringThe UUID of the resource, uniquely identifying this resource4.2.0
descriptionStringDetailed description of the resource4.2.0
typeStringType4.2.0
stateStringState4.2.0
platformUuidStringPlatform UUID4.2.0
createDateTimestampCreation time4.2.0
lastOpDateTimestampLast modification time4.2.0
platformSNSApplicationPlatformInventoryFor details, see platform4.2.0

platform

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource, uniquely identifying this resource5.0.0
nameStringResource name5.0.0
descriptionStringDetailed description of the resource5.0.0
typeStringType5.0.0
createDateTimestampCreation time5.0.0
lastOpDateTimestampLast modification time5.0.0

SDK Examples

Java SDK

CreateSNSFeiShuEndpoint action = new CreateSNSFeiShuEndpoint();
action.url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key\u003df8b9014a-207a-44d5-ae26-3501bf01dbc4";
action.atAll = false;
action.atPersonUserIds = asList("18900002222","13377778888");
action.name = "feishu";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSFeiShuEndpoint.Result res = action.call();

Python SDK

CreateSNSFeiShuEndpoint action = new CreateSNSFeiShuEndpoint()
action.url = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key\u003df8b9014a-207a-44d5-ae26-3501bf01dbc4"
action.atAll = false
action.atPersonUserIds = asList("18900002222","13377778888")
action.name = "feishu"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSFeiShuEndpoint.Result res = action.call()