Repository navigation
Documentation: API
Raynes edited this page Jan 5, 2012
·
25 revisions
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.
-
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 a username and token is provided then the paste will be associated with that account. Otherwise, it will be anonymous.