lus / pasty

pasty is a fast and lightweight code pasting server
https://pasty.lus.pm
MIT License
200 stars 27 forks source link

Api for Dev s #14

Closed arsenikov closed 2 years ago

arsenikov commented 3 years ago

Add a api for pasting to this

kdev commented 3 years ago

You could be smart an "reverse engineer" the api from here: https://github.com/lus/pasty/blob/master/web/assets/js/api.js

MeerBiene commented 3 years ago

POST "api/v1/pastes" HEADERS "Content-Type": "application/json" BODY

{
"content": "example paste"
}

RETURNS

{
"content": "example paste",
"deletionToken": "sdfsdfsdfsdf",
"id": "e87f7hewfun",
"suggestedSyntaxType": "js"
}
lus commented 3 years ago

Hey,

Yeah, as the others mentioned, there technically is a full API to interact with pasty, I was simply too lazy to document it. I am currently working on the v2 API on branch api-refactor which will include a full documentation of all endpoints. Until this point is reached, you could simply use @MeerBiene s kind summary of the paste creation endpoint. If you have any further questions about the API, just comment on this issue, I (or any other helpful fellow) will explain everything to you ^^

lus commented 2 years ago

The API v2 is live on https://pasty.lus.pm now. Documentation can be found here. Feel free to ask further questions if they arise ^^.