CreateSNSDingTalkEndpoint

API Request

URLs
POST zstack/v1/sns/application-endpoints/ding-talk
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "url": "http://dingding-robot-url",
    "atAll": false,
    "atPersonPhoneNumbers": [
      "18900002222",
      "13377778888"
    ],
    "name": "dinding"
  },
  "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":"http://dingding-robot-url","atAll":false,"atPersonPhoneNumbers":["18900002222","13377778888"],"name":"dinding"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/ding-talk
Request Parameters
Name Type Location Description Options Value Starting Version
url String body (contained in the params structure) The URL of the DingTalk robot. 2.3
atAll Boolean body (contained in the params structure) Optional. Whether to notify all (@All) members in a DingTalk group. 2.3
atPersonPhoneNumbers List body (contained in the params structure) Optional. The phone number of the group member to be notified (the @member). 2.3
name String body (contained in the params structure) The resource name. 2.3
description String body (contained in the params structure) Optional. The detailed description of the resource. 2.3
resourceUuid String body (contained in the params structure) Optional. 2.3
systemTags List body Optional. The system tags. 2.3
userTags List body Optional. The user tags. 2.3
platformUuid String body (contained in the params structure) Optional. 2.3

API Response

Sample Response
{
  "inventory": {
    "url": "http://dingding-url",
    "atAll": false,
    "atPersonPhoneNumbers": [
      "18900001111"
    ],
    "name": "example",
    "uuid": "917fe66f76b241f0843dfbd6be685fc1",
    "description": "description example",
    "type": "Email",
    "platformUuid": "4eb0ceebf95b452585ebeacd647d9f35",
    "createDate": "Feb 28, 2018 9:47:10 AM",
    "lastOpDate": "Feb 28, 2018 9:47:10 AM"
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 2.3
inventory SNSDingTalkEndpointInventory See inventory. 2.3
#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. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
Name Type Description Starting Version
url String The URL of the DingTalk robot. 2.3
atAll boolean Whether to notify all (@All) members in a DingTalk group. 2.3
atPersonPhoneNumbers List The phone number of the group member to be notified (the @member). 2.3
name String The resource name. 2.3
uuid String The resource UUID. 2.3
description String The detailed description of the resource. 2.3
type String The endpoint type. 2.3
platformUuid String The application platform UUID. 2.3
createDate Timestamp The creation date. 2.3
lastOpDate Timestamp The last operation date. 2.3

SDK Sample

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 = CreateSNSDingTalkEndpointAction()
action.url = "http://dingding-robot-url"
action.atAll = false
action.atPersonPhoneNumbers = [18900002222, 13377778888]
action.name = "dinding"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateSNSDingTalkEndpointAction.Result res = action.call()