Create PEAURL with friendly word

A tinyurl clone type service dedicated to http://frozenpeafund.com/

PeaURL Api documentation

You can easily create short urls using our api. Below we explain how to use it.
At the moment two output data types are supported: xml and json, json type as default. Possible error codes while you might use the api:
100 Wrong request, only GET method is available
101 Missing link
102 Incorrect link
103 Unknown output data type
104 System unavailable
Possible params:
Param Name Example Value Default Value
link http://example.com/ null
type json, xml json
friendly true false
System understands only GET requests to api. Later we may be add POST method, but it's enough for current usage. So, you can run api from your script like this:
http://peaurl.com/api?link=http://example.com/somepath&type=json
or.. just:
http://peaurl.com/api?link=http://example.com/somepath
Output will be similar to this:
{
  "result": {
    "tag": "CvIMk",
    "peaurl": "http:\/\/peaurl.com\/CvIMk"
  },
  "errors": []
}
If you dislike json you can run it with xml-type output:
http://peaurl.com/api?link=http://example.com/somepath&type=xml
Output will be similar to this:
<?xml version="1.0"?>
<root>
  <result>
    <tag>eRJZN</tag>
    <peaurl>http://peaurl.com/eRJZN</peaurl>
  </result>
  <errors/>
</root>
In case of errors you'll got for url:
http://peaurl.com/api?link=http/example.com/somepath&type=json
{
  "result":{},
  "errors":{
    "102": "Incorrect link"
  }
}
http://peaurl.com/api?link=http/example.com/somepath&type=xml
<?xml version="1.0"?>
<root>
  <result/>
  <errors>
    <error code="102">Incorrect link</error>
  </errors>
</root>