-
Notifications
You must be signed in to change notification settings - Fork 1
/
how-the-calls-are-structured.txt
75 lines (68 loc) · 1.66 KB
/
how-the-calls-are-structured.txt
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
Generalized API call structure looks like:
{
'protocol' => 'http',
'hostname' => 'localhost',
'port' => '',
# 2082 for cPanel and UAPIs
# 2086 for WHM APIs
'json-api' => '',
# 'json-api' for cPanel APIs
# '' or undef for WHM APIs and UAPI
'security_token' => '',
# 'cpsess1234567890' for UAPI
# '' or undef for all else
'execute' => '',
# 'execute' for UAPI
# '' or undef for all else
'cpanel' => '',
# 'cpanel?' for cPanel APIs
# '' or undef for all else
'user' => '',
# 'user=$username' for cPanel APIs
# '' or undef for all else
'cpanel_jsonapi_module' => '',
#
============
WHM0:
$protocol = http
$port = 2086
${protocol}://${hostname}:${port}/json-api/${func}?api.version=0
&arg=value
&arg=value
&arg=value
WHM1:
$protocol = http
$port = 2086
${protocol}://${hostname}:${port}/json-api/${func}?api.version=1
&arg=value
&arg=value
&arg=value
===== I might be wrong about the security tokens for API1 and API2.
===== We might _have_ to authenticate with a password, or as root
===== with a username.
API1:
$protocol = http
$port = 2082
${protocol}://${hostname}:${port}/json-api/cpanel?user=username
&cpanel_jsonapi_module=${module}
&cpanel_jsonapi_func=${func}
&cpanel_jsonapi_version=1
&arg-0=value
&arg-1=value
&arg-2=value
API2:
$protocol = http
$port = 2082
${protocol}://${hostname}:${port}/json-api/cpanel?user=username
&cpanel_jsonapi_module=${module}
&cpanel_jsonapi_func=${func}
&cpanel_jsonapi_version=2
&arg=value
&arg=value
UAPI:
$protocol = http
$port = 2082
${protocol}://${hostname}:${port}/${security_token}/execute/
${module}/${func}?
&arg=val
&arg=val