SHARE
TWEET

APIKOO

a guest Jul 21st, 2019 69 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $api_dev_key        = 'YOUR API DEVELOPER KEY';
  2. $api_user_key       = '';
  3. $api_paste_key      = '';
  4. $url            = 'https://pastebin.com/api/api_post.php';
  5. $ch             = curl_init($url);
  6.  
  7. curl_setopt($ch, CURLOPT_POST, true);
  8. curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_option=delete&api_user_key='.$api_user_key.'&api_dev_key='.$api_dev_key.'&api_paste_key='.$api_paste_key.'');
  9. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  10. curl_setopt($ch, CURLOPT_VERBOSE, 1);
  11. curl_setopt($ch, CURLOPT_NOBODY, 0);
  12.  
  13. $response       = curl_exec($ch);
  14. echo $response;
  15. Possible Good API Responses:
  16. Paste Removed
  17. Possible Bad API Responses:
  18. Bad API request, invalid api_option
  19. Bad API request, invalid api_dev_key
  20. Bad API request, invalid api_user_key
  21. Bad API request, invalid permission to remove paste
  22. Getting A Users Information And Settings
  23. With this API you can obtain a users personal information and certain settings. You will need to send a valid POST request to the url below to access the data:
  24. https://pastebin.com/api/api_post.php
  25. Include all the following POST parameters when you request the url:
  26. 1. api_dev_key - this is your API Developer Key, in your case: YOUR API DEVELOPER KEY
  27. 2. api_user_key - this is the session key of the logged in user. How to obtain such a key
  28. 3. api_option - set as 'userdetails'
  29.  
  30. Below is a PHP example using curl how to create a valid 'api_user_key':
  31. $api_dev_key        = 'YOUR API DEVELOPER KEY';
  32. $api_user_key       = '';
  33. $url            = 'https://pastebin.com/api/api_post.php';
  34. $ch             = curl_init($url);
  35.  
  36. curl_setopt($ch, CURLOPT_POST, true);
  37. curl_setopt($ch, CURLOPT_POSTFIELDS, 'api_option=userdetails&api_user_key='.$api_user_key.'&api_dev_key='.$api_dev_key.'');
  38. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  39. curl_setopt($ch, CURLOPT_VERBOSE, 1);
  40. curl_setopt($ch, CURLOPT_NOBODY, 0);
  41.  
  42. $response       = curl_exec($ch);
  43. echo $response;
  44. Below is an example output of a user information listing:
  45. <user>
  46.     <user_name>wiz_kitty</user_name>
  47.     <user_format_short>text</user_format_short>
  48.     <user_expiration>N</user_expiration>
  49.     <user_avatar_url>https://pastebin.com/cache/a/1.jpg</user_avatar_url>
  50.     <user_private>1</user_private> (0 Public, 1 Unlisted, 2 Private)
  51.     <user_website>https://myawesomesite.com</user_website>
  52.     <user_email>oh@dear.com</user_email>
  53.     <user_location>New York</user_location>
  54.     <user_account_type>1</user_account_type> (0 normal, 1 PRO)
  55. </user>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top