UpdateSNSDingTalkEndpoint
API Request
URLs
PUT zstack/v1/sns/application-endpoints/ding-talk/{uuid}/actionsHeaders
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.
{
"updateSNSDingTalkEndpoint": {
"url": "https://open.ding-talk.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81",
"atAll": false,
"secret": "fiSmveXkeD2jIjrENHYjQd",
"name": "new name",
"description": "desc"
},
"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 PUT -d '{"updateSNSDingTalkEndpoint":{"url":"https://open.ding-talk.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81","atAll":false,"secret":"fiSmveXkeD2jIjrENHYjQd","name":"new name","description":"desc"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/ding-talk/f2d2a456d49f3a9596440448eb4f26de/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| url | String | body (contained in the updateSNSDingTalkEndpoint structure) | Optional. The webhook url. | 5.0.0 | |
| atAll | Boolean | body (contained in the updateSNSDingTalkEndpoint structure) | Optional. @All people. | 5.0.0 | |
| secret | String | body (contained in the updateSNSDingTalkEndpoint structure) | Optional. The secret key. | 5.0.0 | |
| uuid | String | url | The resource uuid. | 5.0.0 | |
| name | String | body (contained in the updateSNSDingTalkEndpoint structure) | Optional. The resource name. | 5.0.0 | |
| description | String | body (contained in the updateSNSDingTalkEndpoint structure) | Optional. The detailed descrption of resource. | 5.0.0 | |
| systemTags | List | body | Optional. The system tag. | 5.0.0 | |
| userTags | List | body | Optional. The user tag. | 5.0.0 |
API Response
Sample
Response
{
"inventory": {
"name": "example",
"uuid": "917fe66f76b241f0843dfbd6be685fc1",
"description": "description example",
"type": "Email",
"state": "Enabled",
"platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
"createDate": "Dec 25, 2023 2:07:46 PM",
"lastOpDate": "Dec 25, 2023 2:07:46 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 |
|---|---|---|---|
| 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 type. | 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 |
SDK Sample
Java
SDK
UpdateSNSDingTalkEndpointAction action = new UpdateSNSDingTalkEndpointAction();
action.url = "https://open.ding-talk.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81";
action.atAll = false;
action.secret = "fiSmveXkeD2jIjrENHYjQd";
action.uuid = "f2d2a456d49f3a9596440448eb4f26de";
action.name = "new name";
action.description = "desc";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateSNSDingTalkEndpointAction.Result res = action.call();Python
SDK
UpdateSNSDingTalkEndpointAction action = UpdateSNSDingTalkEndpointAction()
action.url = "https://open.ding-talk.cn/open-apis/bot/v2/hook/006879a3-0898-4428-aad4-3221db3daf81"
action.atAll = false
action.secret = "fiSmveXkeD2jIjrENHYjQd"
action.uuid = "f2d2a456d49f3a9596440448eb4f26de"
action.name = "new name"
action.description = "desc"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateSNSDingTalkEndpointAction.Result res = action.call()