From 04db74191ead8d2d0f84c37f92238b979676fde4 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 19 Apr 2012 11:13:58 +0200 Subject: [PATCH] docs --- htdocs/application/controllers/api.php | 6 +++++- htdocs/application/views/api_help.php | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/htdocs/application/controllers/api.php b/htdocs/application/controllers/api.php index 19adbd8..3ecee9a 100755 --- a/htdocs/application/controllers/api.php +++ b/htdocs/application/controllers/api.php @@ -20,7 +20,11 @@ class Api extends Main 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() diff --git a/htdocs/application/views/api_help.php b/htdocs/application/views/api_help.php index 78fe038..9cd5274 100755 --- a/htdocs/application/views/api_help.php +++ b/htdocs/application/views/api_help.php @@ -7,7 +7,14 @@

API URL

+

Return values

+

+ On success, the API returns the paste URL in JSON format: {"url":""}
+ On error, the API returns the error message in JSON format: {"error":"missing paste text"} +

+

POST parameters

+

 

text=[your paste text]

The paste content. Required.

@@ -18,10 +25,10 @@ private=1

Make paste private.

-

Return values

+ lang=[language]

- On success, the API returns the paste URL in JSON format: {"url":""}
- On error, the API returns the error message in JSON format: {"error":"missing paste text"} + Use alternative syntax highlighting.
+ Possible values:

Examples

@@ -35,6 +42,10 @@ curl -d private=1 -d name=Herbert --data-urlencode text@/etc/passwd

Create a private paste with the author 'Herbert' and the contents of '/etc/passwd'.

+

Create paste from a php file

+ curl -d lang=php --data-urlencode text@main.php +

Create a paste with PHP syntax highlighting.

+ load->view("defaults/footer");?>