FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
weworkapi_php/api/examples/MenuTest.php at master · EternalSuno/weworkapi_php · GitHub
EternalSuno
/
weworkapi_php
Public
forked from
sbzhu/weworkapi_php
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_php
/
api
/
examples
/
MenuTest.php
Copy path
More file actions
More file actions
Latest commit
History
History
History
57 lines (49 loc) · 1.19 KB
Breadcrumbs
weworkapi_php
/
api
/
examples
/
MenuTest.php
Copy path
File metadata and controls
57 lines (49 loc) · 1.19 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
<?php
/*
* Copyright (C) 2017 All rights reserved.
*
* @File MenuTest.php
* @Brief
* @Author abelzhu, abelzhu@tencent.com
* @Version 1.0
* @Date 2017-12-26
*
*/
include_once
(
"
../src/CorpAPI.class.php
"
);
include_once
(
"
../src/ServiceCorpAPI.class.php
"
);
include_once
(
"
../src/ServiceProviderAPI.class.php
"
);
$
config
=
require
(
'
./config.php
'
);
//
$
agentId
=
$
config
[
'
APP_ID
'
];
$
api
=
new
CorpAPI
(
$
config
[
'
CORP_ID
'
],
$
config
[
'
APP_SECRET
'
]);
try
{
//
$
subMenu
=
new
SubMenu
(
"
subMenu_1
"
,
array
(
new
viewMenu
(
"
viewMenu_1
"
,
"
www.qq.com
"
),
new
viewMenu
(
"
viewMenu_2
"
,
"
www.baidu.com
"
)
)
);
$
scanCodePushMenu
=
new
ScanCodePushMenu
(
"
ScanCodePushMenu
"
,
null
,
array
(
new
viewMenu
(
"
viewMenu_3
"
,
"
www.qq.com
"
),
new
PicWeixinMenu
(
"
PicWeixinMenu
"
,
"
keykeykey
"
,
null
),
)
);
$
menu
=
new
Menu
(
array
(
$
subMenu
,
$
scanCodePushMenu
)
);
$
api
->
MenuCreate
(
$
agentId
,
$
menu
);
//
$
menu
=
$
api
->
MenuGet
(
$
agentId
);
var_dump
(
$
menu
);
//
$
api
->
MenuDelete
(
$
agentId
);
}
catch
(
Exception
$
e
) {
echo
$
e
->
getMessage
() .
"\n"
;
}
Back
|
FazBrowse Home
|
New Git URL