Pen.io API (beta)

INTRODUCTION

The Pen.io API allows developers to build applications that can make use of the Pen.io Network. As well as standard functions such as creating, editing and deleting Pen.io pages, through the API, developers can use Pen.io as a powerful private key store. The API uses standard REST practices.

AUTHENTICATION

To use the Pen.io API, you must have a key. An API key can be generated on this page
Authentication is done using HTTP Basic Authorization and all calls to the API must include your Key in a request header.

Generate an API Key

Example

curl -i -H "api-key: YOURAPIKEYGOESHERE" -X HEAD

CREATE NEW PAGE

POST http://pen.io/pages/

Response Codes

Parameters (POST body):

Example:

curl -i -H "api-key: YOURAPIKEYGOESHERE" -X POST -d "page_name=pagetitlegoeshere&password=password&private=0" \
http://pen.io/pages 

Update page content

PUT http://pen.io/pages/name/

Response codes:

Paramters:

url-encoded name=value pairs, all parameters are optional, but at least one pair should be presented. If a parameter is missed in the request, it will not be changed:

Example:

curl -i -H "api-key: YOURAPIKEYGOESHERE" -X PUT -d "title=Here is a New Title&content=Some New Content&private=1" /
http://resttestpage:[email protected]/pages/resttestpage

Check page availability:

HEAD http://pen.io/pages/name

response codes:

Example:

curl -i -H "api-key: YOURAPIKEYGOESHERE" -X HEAD http://pen.io/pages/resttestpage

Get Page in HTML Format:

GET http://pen.io/pages/name

Response Codes:

Example:

curl -i -H "api-key: YOURAPIKEYGOESHERE" http://resttestpage:[email protected]/pages/resttestpage 

Get Page in JSON Format:

GET http://pen.io/pages/name/json

Response Codes:

Example:

curl -i -H "api-key: YOURAPIKEYGOESHERE" http://resttestpage:[email protected]/pages/resttestpage/json 

Get Page in XML Format:

GET http://pen.io/pages/name/xml

Response Codes:

Example:

curl -i -H "api-key: YOURAPIKEYGOESHERE" http://resttestpage:[email protected]/pages/resttestpage/xml 

Delete a Page:

DELETE http://pen.io/pages/name

Response Codes:

Example:

curl -i  -H "api-key: YOURAPIKEYGOESHERE" -X DELETE http://resttestpage:[email protected]/pages/resttestpage