Piwigo/tools/ws.htm

195 lines
7.3 KiB
HTML

<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title>Piwigo web API (web-services) explorer</title>
<link rel="stylesheet" href="//cdn.jsdelivr.net/tiptip/1.3/tipTip.css">
<link rel="stylesheet" href="../admin/themes/default/fontello/css/fontello.css">
<link rel="stylesheet" href="ws/ws.css">
<link rel="stylesheet" href="ws/jquery.json-viewer.css">
<script src="../themes/default/js/jquery.min.js"></script>
<script src="../themes/default/js/jquery.cookie.js"></script>
<script src="../themes/default/js/plugins/jquery.tipTip.minified.js"></script>
<script src="ws/jquery.json-viewer.js"></script>
<script src="ws/ws.js"></script>
</head>
<body>
<div id="the_body">
<a name="top"></a>
<i class="darkModeButton icon-moon-inv" title="Toogle Dark Mode"></i>
<div id="the_header">
<a title="Go to admin page" href="../admin.php"><img src="ws/piwigo-logo-minimal.svg"></a>
<h1>Piwigo web API (web-services) explorer</h1>
</div> <!-- the_header -->
<div id="the_container">
<div id="the_methods">
<h2>Available methods</h2>
<div id="search">
<i class="icon-search"></i>
<input type="text" placeholder="Search">
</div>
<div id="methodsList">
</div>
</div> <!-- the_methods -->
<div id="the_page">
<div id="the_title">
<h2 id="methodName" style="display:none;"></h2>
<span id="onlys"></span>
</div>
<h2 id="errorWrapper" style="display:none;"></h2>
<div id="the_content">
<form id="urlForm" style="display:none;">
<input type="text" name="ws_url" size="60">
<input type="submit" value="Go!">
</form>
<div class="card" id="introMessage">
<h3 class="card-title"><i class="icon-info-circled-1"></i>What is this page ?</h3>
<div class="card-content">
<p>
<b>API = Application Programming Interface.</b><br>
This is the way other applications can communicate with Piwigo. This feature is also know as Web Services.
</p>
<p>Examples:</p>
<ul>
<li>Wordpress (web blog software) can display random photos from a Piwigo gallery in its sidebar</li>
<li>Lightroom (photo management software for desktop) can create albums and upload photos to Piwigo</li>
</ul>
<p>
This page lists all API methods available on your Piwigo installation, part of the Piwigo core or added by third-party plugins.
For each method you can consult required and optional parameters, and even test them in direct live!
</p>
<p>
For more information you can consult our Wiki <a href="https://github.com/Piwigo/Piwigo/wiki#web-api" target="_blank">Piwigo Web API</a> and <a href="https://piwigo.org/forum" target="_blank">our forums</a>.
</p>
</div>
</div> <!-- introMessage -->
<form id="methodWrapper" style="display:none;">
<div class="card" id="methodDescription" style="display:none;">
<h3 class="card-title"><i class="icon-book"></i>Description</h3>
<blockquote>
</blockquote>
</div> <!-- methodDescription -->
<div id="methodControl">
<div class="methodControlContainer">
<div class="card" id="methodParams">
<h3 class="card-title"><i class="icon-equalizer"></i>Method parameters</h3>
<div class="card-content">
<table>
<thead>
<tr>
<td>Name</td>
<td class="mini">Type</td>
<td>Value</td>
<td class="mini">Send</td>
</tr>
</thead>
<tbody>
</tbody>
</table>
<span class="no-params" style="display: none;">This method takes no parameters</span>
</div>
</div> <!-- methodParams -->
</div> <!-- methodControlContainer -->
<div class="methodControlContainer">
<div class="card" id="testForm">
<h3 class="card-title"><i class="icon-wrench"></i>Test</h3>
<div class="card-content">
<div class="select-group">
<label for='requestFormat'>Request format</label>
<div class="select">
<select id="requestFormat">
<option value="get" selected>GET</option>
<option value="post">POST</option>
</select>
</div>
</div>
<div class='select-group'>
<label for='responseFormat'>Response format</label>
<div class="select">
<select id="responseFormat">
<option value="json" selected>JSON</option>
<option value="rest" selected>REST (xml)</option>
<option value="php">PHP serial</option>
<option value="xmlrpc">XML RPC</option>
</select>
</div>
</div>
<div class="testAction">
<a href="#iframe-bottom" class="button" id="invokeMethod">INVOKE</a>
<a href="#" class="button" id="invokeMethodBlank">INVOKE (new window)</a>
</div>
</div>
</div> <!-- testForm -->
</div> <!-- methodControlContainer -->
</div> <!-- methodControl -->
<div class="card-2" id="requestURLDisplay" style="display:none;">
<h3 class="card-title"><i class="icon-network"></i>Request</h3>
<div class="card-content">
<blockquote>
<pre class="url"></pre>
<pre class="params"></pre>
</blockquote>
</div>
</div> <!-- requestDisplay -->
<div class="card-2" id="requestResultDisplay" style="display:none;">
<h3 class="card-title"><i class="icon-code"></i>Result</h3>
<div class="card-content">
<div id="resultWrapper">
<iframe src="" id="invokeFrame" name="invokeFrame"></iframe>
<pre id="json-viewer"></pre>
</div>
<div id="iframeAction">
<a href="#iframe-bottom" id="increaseIframe"><i class="icon-down-open"></i> increase height</a>
<a href="#iframe-bottom" id="decreaseIframe"><i class="icon-down-open"></i> decrease height</a>
<span id="iframe-bottom"></span>
</div>
</div>
</div>
</form> <!-- resultWrapper -->
<!-- hidden form for POST submition -->
<form method="post" action="" target="" id="invokeForm" style="display:none;"></form>
</div> <!-- the_content -->
</div> <!-- the_page -->
</div> <!-- the_container -->
<div id="the_footer">
Copyright &copy; 2002-2021 <a href="http://piwigo.org">Piwigo Team</a>
</div> <!-- the_footer -->
</div>
</body>
</html>