27require_once
'../../main.inc.php';
30if (!isModEnabled(
'api')) {
31 $langs->load(
"admin");
32 dol_syslog(
"Call of Dolibarr API interfaces with module API REST are disabled");
33 print $langs->trans(
"WarningModuleNotActive",
'Api').
'.<br><br>';
34 print $langs->trans(
"ToActivateModule");
41 $langs->load(
"admin");
42 dol_syslog(
"Call Dolibarr API interfaces with module REST disabled");
43 print $langs->trans(
"WarningAPIExplorerDisabled").
'.<br><br>';
52 if (!in_array($ipremote, $allowedip)) {
54 print
'APIs are not allowed from the IP '.$ipremote;
55 header(
'HTTP/1.1 503 API not allowed from your IP '.$ipremote);
66 <!-- needed
for adaptive design -->
67 <meta charset=
"utf-8"/>
68 <meta
name=
"viewport" content=
"width=device-width, initial-scale=1">
69 <link href=
"https://fonts.googleapis.com/css?family=Montserrat:300,400,700|Roboto:300,400,700" rel=
"stylesheet">
72 ReDoc doesn
't change outer page styles
82 <redoc spec-url='<?php echo DOL_MAIN_URL_ROOT.
'/api/index.php/explorer/swagger.json?DOLAPIKEY='.
GETPOST(
'DOLAPIKEY',
'aZ09'); ?>
'></redoc>
83 <!--<redoc spec-url='https:
84 <!--<redoc spec-url=
'http://petstore.swagger.io/v2/swagger.json'></redoc>-->
85 <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.