Log in New API Help About

The dpaste.com REST API

The API is for programmatic creation of new items. All API usage is anonymous, no authentication required. Per Terms of Service, automated requests should include a User-Agent header and should not exceed a rate of one request per second.

How to use it

  • HTTP POST to http://dpaste.com/api/v2/
  • Fields: content, syntax, title, expiry_days
  • Required field: content
  • Syntax choices: Full list in JSON form

Response contents

  • Response code on success will be HTTP 201 Created
  • Location header will be the created item's URL
  • Response body will also be the item's URL
  • Expires header will be the item's expiry date

Examples

    The curl field spec -F "content=<-" captures stdin to the 'content' field.
  • Basic plain-text item creation: curl -s -F "content=<-" http://dpaste.com/api/v2/
  • Set syntax to Javascript: curl -s -F "syntax=js" -F "content=<-" http://dpaste.com/api/v2/
  • Set expiry (1–365 days): curl -s -F "expiry_days=10" -F "content=<-" http://dpaste.com/api/v2/

More

  • The default API version is 2; using http://dpaste.com/api/ is the same as using http://dpaste.com/api/v2/
  • See the dpaste-tools repo for more examples of API usage.
  • Listed on ProgrammableWeb