From 7c0ba5ce2e87e749a2288d6b83c55ec8c8aca9f9 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 10 Nov 2013 13:24:54 +0100 Subject: [PATCH] #102: api docs --- htdocs/themes/bootstrap/views/api_help.php | 33 ++++--- htdocs/themes/default/views/api_help.php | 33 ++++--- htdocs/themes/geocities/views/api_help.php | 104 +++++++++++---------- 3 files changed, 99 insertions(+), 71 deletions(-) diff --git a/htdocs/themes/bootstrap/views/api_help.php b/htdocs/themes/bootstrap/views/api_help.php index 3cd2ea0..28e0cc1 100644 --- a/htdocs/themes/bootstrap/views/api_help.php +++ b/htdocs/themes/bootstrap/views/api_help.php @@ -9,18 +9,25 @@

Create pastes from the commandline

-

API URL

-

+

API URL

+

-

Return values

-

- On success, the API returns the paste URL:
- On error, the API returns the error message: Error: Missing paste text -

+

Get paste

+

-

POST parameters

-

 

+

Get random paste

+

+

Get recent pastes

+

+ +

Get trending pastes

+

+ +

Create a paste

+

+ +

POST parameters

text=[your paste text]

The paste content. Required.

@@ -45,9 +52,13 @@ reply=[pasteid]

Reply to existing paste.

-

Examples

-

 

+

Return values

+

+ On success, the API returns the paste URL:
+ On error, the API returns the error message: Error: Missing paste text +

+

Examples

Create paste

curl -d text='this is my text'

Create a paste with the text 'this is my text'.

diff --git a/htdocs/themes/default/views/api_help.php b/htdocs/themes/default/views/api_help.php index 43982c8..5caa976 100644 --- a/htdocs/themes/default/views/api_help.php +++ b/htdocs/themes/default/views/api_help.php @@ -5,17 +5,24 @@

Create pastes from the commandline

API URL

+

+ +

Get paste

+

+ +

Get random paste

+

+ +

Get recent pastes

+

+ +

Get trending pastes

+

+ +

Create a paste

-

Return values

-

- On success, the API returns the paste URL:
- On error, the API returns the error message: Error: Missing paste text -

- -

POST parameters

-

 

- +

POST parameters

text=[your paste text]

The paste content. Required.

@@ -40,9 +47,13 @@ reply=[pasteid]

Reply to existing paste.

-

Examples

-

 

+

Return values

+

+ On success, the API returns the paste URL:
+ On error, the API returns the error message: Error: Missing paste text +

+

Examples

Create paste

curl -d text='this is my text'

Create a paste with the text 'this is my text'.

diff --git a/htdocs/themes/geocities/views/api_help.php b/htdocs/themes/geocities/views/api_help.php index 3cd2ea0..5caa976 100644 --- a/htdocs/themes/geocities/views/api_help.php +++ b/htdocs/themes/geocities/views/api_help.php @@ -1,69 +1,75 @@ load->view("defaults/header");?> -
-
- -
-
-

Create pastes from the commandline

+
+

API

+

Create pastes from the commandline

-

API URL

-

+

API URL

+

-

Return values

-

- On success, the API returns the paste URL:
- On error, the API returns the error message: Error: Missing paste text -

+

Get paste

+

-

POST parameters

-

 

+

Get random paste

+

- text=[your paste text] -

The paste content. Required.

+

Get recent pastes

+

- title=[title] -

Title for the paste.

+

Get trending pastes

+

- name=[name] -

The author's name.

+

Create a paste

+

- private=1 -

Make paste private.

+

POST parameters

+ text=[your paste text] +

The paste content. Required.

- lang=[language] -

- Use alternative syntax highlighting.
- Possible values: -

+ title=[title] +

Title for the paste.

- expire=[minutes] -

Set paste expiration.

+ name=[name] +

The author's name.

- reply=[pasteid] -

Reply to existing paste.

+ private=1 +

Make paste private.

-

Examples

-

 

+ lang=[language] +

+ Use alternative syntax highlighting.
+ Possible values: +

-

Create paste

- curl -d text='this is my text' -

Create a paste with the text 'this is my text'.

+ expire=[minutes] +

Set paste expiration.

-

Create paste from a file

- 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'.

+ reply=[pasteid] +

Reply to existing paste.

-

Create paste from a php file

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

Create a paste with PHP syntax highlighting.

+

Return values

+

+ On success, the API returns the paste URL:
+ On error, the API returns the error message: Error: Missing paste text +

+ +

Examples

+

Create paste

+ curl -d text='this is my text' +

Create a paste with the text 'this is my text'.

+ +

Create paste from a file

+ 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.

+ +

Get paste ;-)

+ curl +

Display paste.

-

Get paste ;-)

- curl -

Display paste.

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