Create Feishu Endpoint
Headers
Authorization: OAuth the-session-uuidBody
{
"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/feishuParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| url | String | body (Contained in the params structure) | Feishu bot Webhook URL | 4.2.0 | |
| atAll (Optional) | Boolean | body (Contained in the params structure) | Whether to @ all members | 4.2.0 | |
| atPersonUserIds (Optional) | List | body (Contained in the params structure) | @ user IDs | 4.2.0 | |
| name | String | body (Contained in the params structure) | Resource name | 4.2.0 | |
| description (Optional) | String | body (Contained in the params structure) | Detailed description of the resource | 4.2.0 | |
| platformUuid (Optional) | String | body (Contained in the params structure) | Notification platform UUID | 4.2.0 | |
| resourceUuid (Optional) | String | body (Contained in the params structure) | Resource UUID | 4.2.0 | |
| tagUuids (Optional) | List | body (Contained in the params structure) | Tag UUID list | 4.2.0 | |
| systemTags (Optional) | List | body | System tags | 4.2.0 | |
| userTags (Optional) | List | body | User tags | 4.2.0 | |
| secret (Optional) | String | body (Contained in the params structure) | Feishu secret | 4.2.0 | |
| atPersonList (Optional) | Map | body (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"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 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 |
| inventory | SNSFeiShuEndpointInventory | For details, see inventory | 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 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| url | String | Feishu bot URL | 4.2.0 |
| atAll | boolean | @ all members | 4.2.0 |
| atPersonUserIds | List | @ user IDs | 4.2.0 |
| secret | String | Feishu secret | 4.2.0 |
| name | String | Resource name | 4.2.0 |
| uuid | String | The UUID of the resource, uniquely identifying this resource | 4.2.0 |
| description | String | Detailed description of the resource | 4.2.0 |
| type | String | Type | 4.2.0 |
| state | String | State | 4.2.0 |
| platformUuid | String | Platform UUID | 4.2.0 |
| createDate | Timestamp | Creation time | 4.2.0 |
| lastOpDate | Timestamp | Last modification time | 4.2.0 |
| platform | SNSApplicationPlatformInventory | For details, see platform | 4.2.0 |
platform
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The UUID of the resource, uniquely identifying this resource | 5.0.0 |
| name | String | Resource name | 5.0.0 |
| description | String | Detailed description of the resource | 5.0.0 |
| type | String | Type | 5.0.0 |
| createDate | Timestamp | Creation time | 5.0.0 |
| lastOpDate | Timestamp | Last modification time | 5.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()