Add a WeCom User

POST/zstack/v1/sns/application-endpoints/we-com/at-persons

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "userId": "18099997777",
    "endpointUuid": "3af92b4b14e83963b8565f194f302fce",
    "remark": "jack"
  },
  "systemTags": [],
  "userTags": []
}

In the example above, the systemTags and userTags fields are optional. They are listed to indicate that these two fields can be included in the body.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"userId":"18099997777","endpointUuid":"3af92b4b14e83963b8565f194f302fce","remark":"jack"}}' \
http://localhost:8080/zstack/v1/sns/application-endpoints/we-com/at-persons

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
userIdStringbody (contained in the params structure)WeCom user ID 4.2.0
endpointUuidStringbody (contained in the params structure)WeCom endpoint UUID 4.2.0
resourceUuid (optional)Stringbody (contained in the params structure)Resource UUID 4.2.0
tagUuids (optional)Listbody (contained in the params structure)Tag UUID list 4.2.0
systemTags (optional)ListbodySystem tags 4.2.0
userTags (optional)ListbodyUser tags 4.2.0
remark (optional)Stringbody (contained in the params structure)Remark 4.2.0

API Response

Response Example

{
  "inventory": {
    "uuid": "a3e851f0f2614e6ab11c8ad995cf9ea3",
    "userId": "18988887777",
    "endpointUuid": "2692f0b0ee1746c29f94a23730a1ed07",
    "remark": "jack"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.2.0
errorErrorCodeThe error code. If not null, the operation failed. This field is null when the operation succeeds. For details, see error4.2.0
inventorySNSWeComAtPersonInventoryFor details, see inventory4.2.0

error

NameTypeDescriptionStarting Version
codeStringThe error code number. A globally unique identifier for the error, for example, SYS.1000, HOST.1001.5.0.0
descriptionStringA brief description of the error5.0.0
detailsStringDetailed information about the error5.0.0
elaborationStringReserved field. Default is null.5.0.0
opaqueLinkedHashMapReserved field. Default is null.5.0.0
causeErrorCodeThe root error. The source error that caused the current error. If there is no root error, this field is null.5.0.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe UUID of the resource. Uniquely identifies the resource.4.2.0
userIdStringWeCom user ID4.2.0
endpointUuidStringWeCom endpoint UUID4.2.0

SDK Examples

Java SDK

AddSNSWeComAtPersonAction action = new AddSNSWeComAtPersonAction();
action.userId = "18099997777";
action.endpointUuid = "3af92b4b14e83963b8565f194f302fce";
action.remark = "jack";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddSNSWeComAtPersonAction.Result res = action.call();

Python SDK

AddSNSWeComAtPersonAction action = AddSNSWeComAtPersonAction()
action.userId = "18099997777"
action.endpointUuid = "3af92b4b14e83963b8565f194f302fce"
action.remark = "jack"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddSNSWeComAtPersonAction.Result res = action.call()