· 4 years ago · Jun 14, 2021, 07:40 PM
11. Your Unique Developer API Key
22. Creating A New Paste
33. Creating A New Paste, [Required Parameters]
44. Creating A New Paste, [Optional Parameters]
55. Creating A New Paste, The 'api_paste_format' Parameter In Detail
66. Creating A New Paste, The 'api_paste_expire_date' Parameter In Detail
77. Creating A New Paste, The 'api_paste_private' Parameter In Detail
88. Creating A New Paste, The 'api_folder_key' Parameter In Detail
99. Creating An 'api_user_key' Using The API Member Login System
1010. Listing Pastes Created By A User
1111. Deleting A Paste Created By A User
1212. Getting A Users Information And Settings
1313. Getting raw paste output of users pastes including 'private' pastes
1414. Getting raw paste output of any 'public' & 'unlisted' pastes
15Your Unique Developer API Key
16Everybody using our API is required to use a valid Developer API Key. You automatically get a key when you become a member of Pastebin. Please login to your account, and return to this page to find your Developer API Key.
17Creating A New Paste
18Creating a new paste via our API is very easy. You simply have to send a valid POST request to the url shown below. Please make sure you are sending the data
19as the UTF-8 charset.
20https://pastebin.com/api/api_post.php
21Below is a PHP example using curl how to create a new paste:
22$api_dev_key = 'YOUR API DEVELOPER KEY'; // your api_developer_key
23$api_paste_code = 'just some random text you :)'; // your paste text
24$api_paste_private = '1'; // 0=public 1=unlisted 2=private
25$api_paste_name = 'justmyfilename.php'; // name or title of your paste
26$api_paste_expire_date = '10M';
27$api_paste_format = 'php';
28$api_user_key = ''; // if an invalid or expired api_user_key