Skip to content
github-actions[bot] edited this page Mar 15, 2024 · 1 revision

Welcome to PasteMyst.NET's wiki!

Getting Started

Note: You need to have a .NET Standard 2.1 compatible framework in order to be able to use this in your project!

Install the package inside your project via CLI or the package manager.

dotnet add package PasteMystNet

Then, inside your file, import the required namespaces.

using PasteMystNet;

Create the client. And if you have a token for your account, you may also input them into the constructor.

var client = new PasteMystClient();
var authorizedClient = new PasteMystClient("<YOUR_TOKEN_HERE>");

Create a form for a new paste.

var pasteForm = new PasteMystPasteForm
{
    Title = "My Paste",
    Pasties =
    [
        new PasteMystPastyForm
        {
            Content = "Hello, world!"
        }
    ]
};

Then, post the paste to the API.

var paste = await client.CreatePasteAsync(pasteForm);
Console.WriteLine("Paste URL: https://paste.myst.rs/" + paste.Id);

You're all set! 😁 If you want to learn more, check out the tutorials page.

Clone this wiki locally