Adds a paste. Destination of your request must be:
http://nopaste.me/api
via
POST
At the moment the limitation is a maximum of 50 added pastes per 1 Hour(s)
- Name
- Required
- Maximum length
- Type
- Default
- Options
name
- not required
- 255
- string
- none
- none
Paste name
author
- not required
- 255
- string
- none
- none
Author of paste
code
- required
- 512000
- string
- none
- none
Code of paste. Important: The Code must be urlencoded (use new lines with %0A) and uft8 encoded
language
- not required
- 255
- string
- plain-text
- none
Language of the paste
The result (return) format
private
- not required
- none
- int
- none
- 1, 0
Privacy setting
Verification code
When the paste was added this values will be returned if the request was Success
Containing the truth value (in this case true)
Containing the given language
Containing the given paste name
Containing the given value for private
Containing the given author name
Containing the url where the paste was pasted
After the request was Failure it will return this values
Containing the truth value (in this case false)
Containing the error message
This is a small curl POST request in PHP example for creating a
private
paste with the name
My first Test Paste!
$parameter = array(
// required settings
'method' => 'paste', // method
'code' => urlencode(utf8_encode('Hey there')), // encoded code & encoded with utf-8
'apiKey' => 'YOURAPIKEY', // your api key
// additional settings
'private' => 1, // is private
'name' => 'My first Test Paste!' // name of the paste
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://nopaste.me/api");
curl_setopt($ch, CURLOPT_POST, count($parameter)); // howmany parameter to post
curl_setopt($ch, CURLOPT_POSTFIELDS, $parameter); // post!
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // we want to see what happend
$result = curl_exec($ch); // get the result
curl_close($ch); // close curl
print $result; // give us the result