It's just another text storage service built in fastify.
Ofcouse we have an public API without any api-key required. Let's get started with it...
Get a paste from the storage -
POST /api/get HTTP/1.1Host: dustbin.meContent-Type: application/json
{ "fileId": "<string>" }The request body is provided in place -
POST /api/new HTTP/1.1Host: dustbin.meContent-Type: application/json
{ "data" : "<string>", "language": "string" }Get a paste in browser -
GET /paste/{fileId} HTTP/1.1Host: dustbin.meGet raw paste in browser -
GET /paste/{fileId}/raw HTTP/1.1Host: dustbin.meDownload a paste in browser -
GET /paste/{fileId}/download HTTP/1.1Host: dustbin.meimportrequests# Create A New Pastenew_req=requests.post(
'https://dustbin.me/api/new',
json={
'data': 'def main():\n\tprint("Hello World!")\n\nif __name__ == "__main__":\n\tmain()',
'language': 'Python',
})
print(new_req.json())
paste_id=new_req.json()['id']
# Get The Same Pastepaste_req=requests.post(
'https://dustbin.me/api/paste/',
json={'fileId': paste_id},
)
print(paste_req.json())import'dart:convert';
import'package:http/http.dart'as http;
voidmain(List<String>? arguments) async {
// Create A New Pastevar new_req =await http.post(
Uri.parse('https://dustbin.me/api/new'),
body: {
'data':'void main() {\n\tprint("Hello World!");\n}',
'language':'Dart',
}
);
print(new_req.body);
finalString pasteId =jsonDecode(new_req.body)['id'];
// Get The Same Pastevar paste_req =await http.post(
Uri.parse('https://dustbin.me/api/get/'),
body: {
'fileId': pasteId,
}
);
print(paste_req.body);
}