28require_once
'../../main.inc.php';
39if (!isModEnabled(
'api')) {
40 $langs->load(
"admin");
41 dol_syslog(
"Call of Dolibarr API interfaces with module API REST are disabled");
42 print $langs->trans(
"WarningModuleNotActive",
'Api').
'.<br><br>';
43 print $langs->trans(
"ToActivateModule");
50 $langs->load(
"admin");
51 dol_syslog(
"Call Dolibarr API interfaces with module REST disabled");
52 print $langs->trans(
"WarningAPIExplorerDisabled").
'.<br><br>';
61 if (!in_array($ipremote, $allowedip)) {
63 print
'APIs are not allowed from the IP '.$ipremote;
64 header(
'HTTP/1.1 503 API not allowed from your IP '.$ipremote);
75 <!-- needed
for adaptive design -->
76 <meta charset=
"utf-8"/>
77 <meta
name=
"viewport" content=
"width=device-width, initial-scale=1">
78 <link href=
"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel=
"stylesheet">
81 ReDoc doesn
't change outer page styles
91 <redoc spec-url='<?php echo DOL_MAIN_URL_ROOT.
'/api/index.php/explorer/swagger.json?DOLAPIKEY='.
GETPOST(
'DOLAPIKEY',
'aZ09'); ?>
'></redoc>
92 <!--<redoc spec-url='https:
93 <!--<redoc spec-url=
'http://petstore.swagger.io/v2/swagger.json'></redoc>-->
94 <script src=
"https://cdn.jsdelivr.net/npm/redoc/bundles/redoc.standalone.js"> </script>
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
getUserRemoteIP()
Return the IP of remote user.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
$conf db name
Only used if Module[ID]Name translation string is not found.