Create DingTalk Endpoint

POST/zstack/v1/sns/application-endpoints/ding-talk

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "url": "http://dingding-robot-url",
    "atAll": false,
    "secret": "SECca7c224f47ab16fbe51050ae0b8ebfc505b2b866fc0eb3768c8d79527d1bacc0",
    "atPersonPhoneNumbers": [
      "18900002222",
      "13377778888"
    ],
    "atPersonList": {
      "13377778888": "jack"
    },
    "name": "dinding"
  },
  "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":"http://dingding-robot-url","atAll":false,"secret":"SECca7c224f47ab16fbe51050ae0b8ebfc505b2b866fc0eb3768c8d79527d1bacc0","atPersonPhoneNumbers":["18900002222","13377778888"],"atPersonList":{"13377778888":"jack"},"name":"dinding"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/ding-talk

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
urlStringbody (Contained in the params structure)DingTalk robot URL 2.3
atAll (Optional)Booleanbody (Contained in the params structure)Whether to @ all users in the message 2.3
atPersonPhoneNumbers (Optional)Listbody (Contained in the params structure)Phone numbers of users to @ 2.3
nameStringbody (Contained in the params structure)Resource name 2.3
description (Optional)Stringbody (Contained in the params structure)Detailed description of the resource 2.3
resourceUuid (Optional)Stringbody (Contained in the params structure)  2.3
systemTags (Optional)ListbodySystem tags 2.3
userTags (Optional)ListbodyUser tags 2.3
platformUuid (Optional)Stringbody (Contained in the params structure)Notification platform UUID 2.3
tagUuid (Optional)Listbody (Contained in the params structure)Tag UUID list 5.0.0
secret (Optional)Stringbody (Contained in the params structure)DingTalk secret key 5.0.0
atPersonList (Optional)Mapbody (Contained in the params structure)@ user information 5.0.0

API Response

Response example

{
  "inventory": {
    "url": "http://dingding-url",
    "atAll": false,
    "secret": "SECca7c224f47ab16fbe51050ae0b8ebfc505b2b866fc0eb3768c8d79527d1bacc0",
    "atPersonPhoneNumbers": [
      "18900001111"
    ],
    "name": "example",
    "uuid": "917fe66f76b241f0843dfbd6be685fc1",
    "description": "description example",
    "type": "Email",
    "state": "Enabled",
    "platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
    "createDate": "Mar 26, 2024 2:43:38 AM",
    "lastOpDate": "Mar 26, 2024 2:43:38 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 error2.3
inventorySNSDingTalkEndpointInventoryFor details, see inventory2.3

error

NameTypeDescriptionStarting Version
codeStringThe error code number, a globally unique identifier for the error, for example, SYS.1000 or HOST.10010.6
descriptionStringA brief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Defaults to null0.6
opaqueLinkedHashMapReserved field. Defaults to null0.6
causeErrorCodeThe root error that caused the current error. This field is null if there is no root cause0.6

inventory

NameTypeDescriptionStarting Version
urlStringDingTalk robot URL2.3
atAllbooleanWhether to @ all users2.3
secretStringDingTalk secret key5.0.0
atPersonPhoneNumbersListPhone numbers of @ users2.3
nameStringResource name2.3
uuidStringThe UUID of the resource, uniquely identifying this resource2.3
descriptionStringDetailed description of the resource2.3
typeStringEndpoint type2.3
stateStringState5.0.0
platformUuidStringApplication platform UUID2.3
createDateTimestampCreation time2.3
lastOpDateTimestampLast modification time2.3
platformSNSApplicationPlatformInventoryFor details, see platform5.0.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

CreateSNSDingTalkEndpointAction action = new CreateSNSDingTalkEndpointAction();
action.url = "http://dingding-robot-url";
action.atAll = false;
action.atPersonPhoneNumbers = asList("18900002222","13377778888");
action.name = "dinding";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateSNSDingTalkEndpointAction.Result res = action.call();

Python SDK

CreateSNSDingTalkEndpointAction action = new CreateSNSDingTalkEndpointAction()
action.url = "http://dingding-robot-url"
action.atAll = false
action.atPersonPhoneNumbers = asList("18900002222","13377778888")
action.name = "dinding"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSDingTalkEndpointAction.Result res = action.call()