Skip to content

Paste API v1

Ryan Voots edited this page Apr 23, 2017 · 8 revisions

All API calls live under a base url of /api/v1/

POST /paste

Create a new paste

Parameters

Encoding is standard for encoding

  • name - Username that's pasting this
  • chan - channel announcement identifier, optional
  • desc - Subject of the paste
  • language - language of the paste, currently stored but unused. qw/perl perl4 perl5.5 perl5.6 perl5.8 perl 5.10 perl 5.12 perl5.14 perl5.16 perl5.18 perl5.20 perl5.22 perl5.24 text/
  • expire - How many hours should this paste be alive for
  • paste - Contents of the paste itself

Returns

{
  "url": "https://perlbot.pl/pastebin/foobar", 
  "id": "foobar"
}

GET /paste/:id

Get contents of a paste

Returns

{
 "paste": "paste contents...", 
 "when": "2017-01-01T00:00:00Z", 
 "name": "simcop2387", 
 "desc": "I broke this", 
 "output": "hello world"
}

GET /channels

Get information about supported announcement channels

Returns

{"channels": [
  {"id": "localhost:perlbot:#perl",
   "name": "Freenode #perl",
  },
  ...
]}

Clone this wiki locally