FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
weworkapi_python/api/examples/UserTest.py at master · ly1102/weworkapi_python · GitHub
ly1102
/
weworkapi_python
Public
forked from
sbzhu/weworkapi_python
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
weworkapi_python
/
api
/
examples
/
UserTest.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
63 lines (53 loc) · 1.24 KB
Breadcrumbs
weworkapi_python
/
api
/
examples
/
UserTest.py
Copy path
File metadata and controls
63 lines (53 loc) · 1.24 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
#!/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/"
)
from
CorpApi
import
*
from
TestConf
import
*
## test
api
=
CorpApi
(
TestConf
[
'CORP_ID'
],
TestConf
[
'CONTACT_SYNC_SECRET'
])
try
:
##
response
=
api
.
httpCall
(
CORP_API_TYPE
[
'USER_CREATE'
],
{
'userid'
:
'zhangsan'
,
'name'
:
'zhangsanfeng'
,
'mobile'
:
'131488888888'
,
'email'
:
'zhangsan@ipp.cas.cn'
,
'department'
:
1
,
})
print
response
##
response
=
api
.
httpCall
(
CORP_API_TYPE
[
'USER_GET'
],
{
'userid'
:
'zhangsan'
,
})
print
response
##
response
=
api
.
httpCall
(
CORP_API_TYPE
[
'USER_DELETE'
],
{
'userid'
:
'zhangsan'
,
})
print
response
except
ApiException
as
e
:
print
e
.
errCode
,
e
.
errMsg
##
response
=
api
.
httpCall
(
CORP_API_TYPE
[
'USER_DELETE'
],
{
'userid'
:
'zhangsan'
,
})
print
response
Back
|
FazBrowse Home
|
New Git URL