Skip to content

Latest commit

 

History

History
44 lines (36 loc) · 962 Bytes

File metadata and controls

44 lines (36 loc) · 962 Bytes

PastebinAPI

Code Usage

Import PastebinAPI

using PastebinAPI.API;
using PastebinAPI.API.APIObject;

Connect with pastebin

PasteKey key = await PasteKeyBuilder.GenerateKeyAsync("your_developer_key", "your_username", "your_password");
Pastebin pastebin = new Pastebin(key);

Create new paste

PasteBuilder paste = new PasteBuilder();
paste.Title = "Your paste title.cs";
paste.Text = "Your paste content";
paste.Visibility = Visibility.Public;
paste.ExpireTime = ExpireTimer.Never;
paste.Format = "csharp";

string pasteUrl = await pastebin.CreateNewPasteAsync(paste);

Read paste

string content = await pastebin.ReadOwnPasteAsync(pasteUrl);

//public pastes
string content = await pastebin.ReadPasteAsync(pasteUrl);

Delete paste

await pastebin.DeletePasteAsync(pasteUrl);

Get list of your pastes

List<Paste> pastes = await pastebin.GetPastesAsync(limit: 100);