The API is for programmatic creation of new items. Anonymous use is
permitted, and is the default. Per Terms
of Service, automated requests should include a
User-Agent header and should not exceed a rate of one
request per second.
Authenticated use is identical to anonymous use, with the addition of an
Authorization header passed with your request. So, if you want created items to be linked to your account: log in, visit the dashboard, press the "Generate" button under "API token", and copy the resulting 16-character value.
Pass the token via an HTTP Authorization header, like this:
Authorization: Bearer a1b2c3d4e5f6g7h8
To deactivate (delete) the current token and create a new one, press "Regenerate".
The curl field spec
-F "content=<-" captures stdin to the 'content' field.
curl -s -F "content=<-" https://dpaste.com/api/v2/
curl -s -F "syntax=js" -F "content=<-" https://dpaste.com/api/v2/
curl -s -F "expiry_days=10" -F "content=<-" https://dpaste.com/api/v2/