Update DingTalk Endpoint

PUT/zstack/v1/sns/application-endpoints/ding-talk/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "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": []
}

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 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/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
url (Optional)Stringbody (Contained in the updateSNSDingTalkEndpoint structure)DingTalk Webhook URL 4.2.0
atAll (Optional)Booleanbody (Contained in the updateSNSDingTalkEndpoint structure)@ all members 4.2.0
secret (Optional)Stringbody (Contained in the updateSNSDingTalkEndpoint structure)DingTalk secret 4.2.0
uuidStringurlThe UUID of the resource, uniquely identifying this resource 4.2.0
name (Optional)Stringbody (Contained in the updateSNSDingTalkEndpoint structure)Resource name 4.2.0
description (Optional)Stringbody (Contained in the updateSNSDingTalkEndpoint structure)Detailed description of the resource 4.2.0
systemTags (Optional)ListbodySystem tags 4.2.0
userTags (Optional)ListbodyUser tags 4.2.0

API Response

Response example

{
  "inventory": {
    "name": "example",
    "uuid": "917fe66f76b241f0843dfbd6be685fc1",
    "description": "description example",
    "type": "Email",
    "state": "Enabled",
    "platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
    "createDate": "Mar 26, 2024 2:46:01 AM",
    "lastOpDate": "Mar 26, 2024 2:46:01 AM"
  }
}
NameTypeDescriptionStarting Version
successboolean 5.0.0
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error5.0.0
inventorySNSApplicationEndpointInventoryFor details, see inventory5.0.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
nameStringResource name5.0.0
uuidStringThe UUID of the resource, uniquely identifying this resource5.0.0
descriptionStringDetailed description of the resource5.0.0
typeStringType5.0.0
platformUuidStringApplication platform UUID5.0.0
createDateTimestampCreation time5.0.0
lastOpDateTimestampLast modification time5.0.0

SDK Examples

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()