mirror of
https://github.com/claudehohl/Stikked.git
synced 2025-04-26 04:51:08 -05:00
docs
This commit is contained in:
parent
5bd2af5382
commit
04db74191e
@ -20,7 +20,11 @@ class Api extends Main
|
|||||||
|
|
||||||
function index()
|
function index()
|
||||||
{
|
{
|
||||||
$this->load->view('api_help');
|
$languages = $this->languages->get_languages();
|
||||||
|
$languages = array_keys($languages);
|
||||||
|
$languages = implode(', ', $languages);
|
||||||
|
$data['languages'] = $languages;
|
||||||
|
$this->load->view('api_help', $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
function create()
|
function create()
|
||||||
|
@ -7,7 +7,14 @@
|
|||||||
<h2>API URL</h2>
|
<h2>API URL</h2>
|
||||||
<p class="explain"><code><?php echo site_url('api/create'); ?></code></p>
|
<p class="explain"><code><?php echo site_url('api/create'); ?></code></p>
|
||||||
|
|
||||||
|
<h2>Return values</h2>
|
||||||
|
<p class="explain">
|
||||||
|
On success, the API returns the paste URL in JSON format: <code>{"url":"<?php echo site_url('view/68582786'); ?>"}</code><br />
|
||||||
|
On error, the API returns the error message in JSON format: <code>{"error":"missing paste text"}</code>
|
||||||
|
</p>
|
||||||
|
|
||||||
<h2>POST parameters</h2>
|
<h2>POST parameters</h2>
|
||||||
|
<p> </p>
|
||||||
|
|
||||||
<code>text=[your paste text]</code>
|
<code>text=[your paste text]</code>
|
||||||
<p class="explain">The paste content. Required.</p>
|
<p class="explain">The paste content. Required.</p>
|
||||||
@ -18,10 +25,10 @@
|
|||||||
<code>private=1</code>
|
<code>private=1</code>
|
||||||
<p class="explain">Make paste private.</p>
|
<p class="explain">Make paste private.</p>
|
||||||
|
|
||||||
<h2>Return values</h2>
|
<code>lang=[language]</code>
|
||||||
<p class="explain">
|
<p class="explain">
|
||||||
On success, the API returns the paste URL in JSON format: <code>{"url":"<?php echo site_url('view/68582786'); ?>"}</code><br />
|
Use alternative syntax highlighting.<br />
|
||||||
On error, the API returns the error message in JSON format: <code>{"error":"missing paste text"}</code>
|
Possible values: <?php echo $languages; ?>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<h2>Examples</h2>
|
<h2>Examples</h2>
|
||||||
@ -35,6 +42,10 @@
|
|||||||
<code>curl -d private=1 -d name=Herbert --data-urlencode text@/etc/passwd <?php echo site_url('api/create'); ?></code>
|
<code>curl -d private=1 -d name=Herbert --data-urlencode text@/etc/passwd <?php echo site_url('api/create'); ?></code>
|
||||||
<p class="explain">Create a private paste with the author 'Herbert' and the contents of '/etc/passwd'.</p>
|
<p class="explain">Create a private paste with the author 'Herbert' and the contents of '/etc/passwd'.</p>
|
||||||
|
|
||||||
|
<h3>Create paste from a php file</h3>
|
||||||
|
<code>curl -d lang=php --data-urlencode text@main.php <?php echo site_url('api/create'); ?></code>
|
||||||
|
<p class="explain">Create a paste with PHP syntax highlighting.</p>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php $this->load->view("defaults/footer");?>
|
<?php $this->load->view("defaults/footer");?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user