You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raynes edited this page Jan 5, 2012
·
25 revisions
Introduction
RefHeap has a simple API. The API is token-based and also works without authentication (for now -- future API methods may require authentication). To get an API token, create an account on RefHeap and go to the API page. You can view/generate API tokens there.
All of the API methods return JSON. If there is an exception, the JSON object returned will have an error key.
Methods
/api/paste/create
username: Optional.
token: Optional. Token associated with username.
private: Optional. Either "true" or "false". Defaults to "false".
language: Optional. A string of which language to use for the paste. If this is not provided or the language is unrecognizable, the API defaults to "Plain Text". The language must be exactly the same as how it is listed in the dropdown on RefHeap. If the language is "Nginx Configuration" then that is exactly how it must appear when passed to the API.
contents: Required. A string of text that will be the body of the paste. This cannot be empty.
Create a new paste. If no username and token is provided then the paste will be associated with that account. Otherwise, it will be anonymous.