How to use it
- HTTP POST to
http://dpaste.com/api/v2/ - Fields: content, syntax, title, poster, 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/
Set username from current environment: curl -s -F "poster=$USER" -F "content=<-" http://dpaste.com/api/v2/
More
- See the dpaste-tools repo for more examples of API usage.
- Listed on ProgrammableWeb