· 6 years ago · Oct 25, 2019, 02:16 AM
1Below is a PHP example using curl how to create a new paste:
2$api_dev_key = 'YOUR API DEVELOPER KEY'; // your api_developer_key
3$api_paste_code = 'just some random text you :)'; // your paste text
4$api_paste_private = '1'; // 0=public 1=unlisted 2=private
5$api_paste_name = 'justmyfilename.php'; // name or title of your paste
6$api_paste_expire_date = '10M';
7$api_paste_format = 'php';
8$api_user_key = ''; // if an invalid or expired api_user_key is used, an error will spawn. If no api_user_key is used, a guest paste will be created
9$api_paste_name = urlencode($api_paste_name);
10$api_paste_code = urlencode($api_paste_code);
11
12$url = 'https://pastebin.com/api/api_post.php';
13$ch = curl_init($url);