paste.xcode.ro » ~/paste/documentation
paste.xcode.ro • API



XML Output

JSON Output

This pastebin API provides the following functions that can be hit by a GET or a POST request. The functions return the result in XML/JSON format depending upon the page to which the HTTP request is made.
API → Create
To create a new paste, you need to send a GET or POST request with certain parameters to http://paste.xcode.ro/

Mandatory parameters
  • paste_data - The text to be pasted
  • paste_lang - The development language used
  • api_submit - Set this parameter to true
  • mode - Pass xml or json to this parameter
Optional parameters
  • paste_user - An alphanumeric username of the paste author
  • paste_password - A password string to protect the paste
  • paste_private - Private post flag, having the values: yes or no
  • paste_expire - Time in seconds after which paste will be deleted from server. Set this value to 0 to disable this feature.
  • paste_project - Whether to associate a project with the paste
For a list of supported language codes for the paste_lang parameter, see http://paste.xcode.ro/doc/lang.

Return values on success
  • id - ID of the paste
  • hash - Hash/key for the paste (only for private pastes)
URLs can be framed as http://paste.xcode.ro/<id> for public pastes and http://paste.xcode.ro/<id>/<hash> for private pastes.

Return values on error
A parameter error with one of these error codes is returned:
  • err_nothing_to_do - When no POST request was received by the create API
  • err_author_numeric - The paste author's alias should be alphanumeric
  • err_save_error - Indicates that an error occurred while saving the paste
API → Show
The paste show API listens to both GET and POST requests and returns XML/JSON data. Even though you can use both methods to retrieve all information, we strongly recommend that you use POST when sending password over to the pastebin server.

You can send the http GET request in the following format: http://paste.xcode.ro/api/<format>/<id>/<hash>/<password>.
You may send a POST request to http://paste.xcode.ro/show.php

Mandatory parameters
  • id - ID of the paste
  • format - The format (xml or json) in which you want the result
Optional parameters
  • hash - Hash/key for the paste (only for private pastes)
  • password - Password to unlock the paste (only for protected pastes)
Return values on success
  • id - ID of the paste
  • author - Author of the paste
  • timestamp - UNIX timestamp representing paste creation time
  • language - Language of the paste data
  • data - The paste data
Return values on error
A parameter error with one of these error codes is returned:
  • err_not_found - Paste not found
  • err_invalid_hash - Invalid hash code
  • err_password_required - Password required to view the paste
  • err_invalid_password - Incorrect password entered
API → List
For getting a list of paste IDs, send a GET request to http://paste.xcode.ro/api/<format>/all or http://paste.xcode.ro/api/<format>/all/<page>.
For project specific data, use http://paste.xcode.ro/~<project>/api/<format>/all/<page> (page is optional).

Mandatory parameters
  • format - The format (xml or json) in which you want the result
Optional parameters
  • project - Project that the paste collection belongs to
  • page - The list page to be fetched
Return values on success
  • pastes - Contains sub-elements like paste1, paste2 etc. each of which have a paste ID
  • count - Number of paste elements enclosed within pastes
  • pages - Total number of pages
Return values on error
A parameter error with one of these error codes is returned:
  • err_no_pastes - No pastes found