Creating a Paste

To create a new paste, send a POST request to http://p.fdzh.org/api/paste. Light Paste will check the request for the following parameters:
NameTypeDescriptionRequired
textstringContents of the pasteYes
languagestringPaste languageNo
visibilitystringVisibility of the pasteNo
expirationstringWhen the paste should expireNo
The following table contains possible values for the parameters listed above:
ParameterPossible ValuesDefault
language
c
c++
c#
php
lua
javascript
java
ruby
html
python
css
scss
less
sql
mysql
go
markdown
yaml
coffeescript
apl
clojure
cobol
commonlisp
d
dtd
ecl
eiffel
erlang
fortran
f#
groovy
haskell
smarty
mirc
shell
nginx
dockerfile
perl
rust
cmake
none
visibility
public
private
public
expiration
5 minutes
10 minutes
30 minutes
1 hour
1 day
1 week
1 month
none
If an optional parameter is supplied with an invalid value, or is not listed in the request, the parameter will use its default value as listed above. If the paste was successfully created, Light Paste will send a response in the following format:
HTTP/1.1 201 Created
Content-Type: application/json; charset=utf-8

{
    "paste_id", "ZxMo14a2"
}

Retrieving a Paste

To retrieve a paste, send a GET request to http://p.fdzh.org/api/paste/**paste_id** and replace **paste_id** with the id of the paste that you are looking for. If the request was successful, Light Paste will send a response in the following format:
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8

{
    "id", "ZxMo14a2"
    "text", "VGVzdCBwYXN0ZQ=="
    "language", "lua"
    "time", "1393114519"
    "views", "10"
    "md5", "96a6eddfb4173bcad25228990720a2d9"
    "sha1", "63c4e4e27cf625a637abe04f0a9faa9f08a2e310"
}
Note: The text field listed in the response body will contain the paste's text encoded in Base 64.

Errors

When an API request is unsuccessful or encounters an error, Light Paste will send a response in following format:
HTTP/1.1 **status code**
Content-Type: application/json; charset=utf-8

{
    "error", "true"
    "error_message", "**error_message**"
}