forked from sbzhu/weworkapi_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessageTest.py
More file actions
87 lines (37 loc) · 1.09 KB
/
Copy pathMessageTest.py
File metadata and controls
87 lines (37 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/env python
# -*- coding:utf-8 -*-
##
# Copyright (C) 2018 All rights reserved.
#
# @File UserTest.py
# @Brief
# @Author abelzhu, abelzhu@tencent.com
# @Version 1.0
# @Date 2018-02-24
#
#
import sys
sys.path.append("../src/")
sys.path.append("api/src")
import random
from CorpApi import *
from TestConf import *
## test
api = CorpApi(TestConf['CORP_ID'], TestConf['APP_SECRET'])
try :
##
response = api.httpCall(
CORP_API_TYPE['MESSAGE_SEND'],
{
"toparty": "2",
"agentid": 0,
'msgtype' : 'text',
'climsgid' : 'climsgidclimsgid_%f' % (random.random()),
'text' : {
'content':'姜阳提醒你24:00前认真填写日报是执行力强的优秀品质,更是通过填写不断理解工作范围职责,提升工作能力,提高分析问题、解决问题的能力!',
},
'safe' : 0,
})
print (response )
except ApiException as e :
print((e.errCode, e.errMsg))