CreateSNSFeiShuEndpoint
API Request
URLs
POST zstack/v1/sns/application-endpoints/feishuHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"url": "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key\u003df8b9014a-207a-44d5-ae26-3501bf01dbc4",
"atAll": false,
"atPersonUserIds": [
"18900002222",
"13377778888"
],
"secret": "DPKfmrIhYXY5M2TWGXy0ed",
"atPersonList": {
"13377778888": "jack"
},
"name": "feishu"
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
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/feishuRequest Parameters
| Name | Type | Location | Description | Options Value | Starting Version |
|---|---|---|---|---|---|
| url | String | body (contained in the params structure) | The webhook URL of the FeiShu robot. | 5.0.0 | |
| atAll | Boolean | body (contained in the params structure) | Optional. Whether to notify all (@All) members in a FeiShu group. | 5.0.0 | |
| atPersonUsersId | List | body (contained in the params structure) | Optional. The user id of the group member to be notified (the @member). | 5.0.0 | |
| name | String | body (contained in the params structure) | The resource name. | 5.0.0 | |
| description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 5.0.0 | |
| platformUuid | String | body (contained in the params structure) | The notificatiin platform uuid. | 5.0.0 | |
| resourceUuid | String | body (contained in the params structure) | Optional. The resource uuid. | 5.0.0 | |
| systemTags | List | body | Optional. The system tags. | 5.0.0 | |
| userTags | List | body | Optional. The user tags. | 5.0.0 | |
| tagUuids | List | body (contained in the params structure) | Optional. The tag uuid list. | 5.0.0 | |
| secret | String | body (contained in the params structure) | Optional. The FeiShu secret key. | 5.0.0 | |
| atPersonList | Map | body (contained in the params structure) | Optional. The @person information. (Recommend) | 5.0.0 |
API Response
Sample
Response
{
"inventory": {
"url": "http://feishu-url",
"atAll": false,
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Dec 25, 2023 2:06:05 PM",
"lastOpDate": "Dec 25, 2023 2:06:05 PM"
}
}#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 5.0.0 |
| description | String | The brief description of the error. | 5.0.0 |
| details | String | The details about the error. | 5.0.0 |
| elaboration | String | The reserved field. Default value: null. | 5.0.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 5.0.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 5.0.0 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| url | String | The URL of the DingTalk robot. | 5.0.0 |
| atAll | boolean | Whether to notify all (@All) members in a DingTalk group. | 5.0.0 |
| secret | String | The DingTalk secret key. | 5.0.0 |
| atPersonUserIds | List | The user id of the group member to be notified (the @member). | 5.0.0 |
| name | String | The resource name. | 5.0.0 |
| uuid | String | The resource UUID. | 5.0.0 |
| description | String | The detailed description of the resource. | 5.0.0 |
| type | String | The endpoint type. | 5.0.0 |
| state | String | The application platform. | 5.0.0 |
| platformUuid | String | The application platform UUID. | 5.0.0 |
| createDate | Timestamp | The creation date. | 5.0.0 |
| lastOpDate | Timestamp | The last operation date. | 5.0.0 |
| platform | SNSApplicationPlatformInventory | See platform. | 5.0.0 |
platform
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource uuid. | 5.0.0 |
| name | String | The resource name. | 5.0.0 |
| description | String | The detailed description of the resource. | 5.0.0 |
| type | String | The resource type. | 5.0.0 |
| createDate | Timestamp | The creation date. | 5.0.0 |
| lastOpDate | Timestamp | The last operation date. | 5.0.0 |
SDK Sample
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()