API of dumpz.org


/api/dump

POST

Creates new dump. Accepts content of dump in POST body.

If you use curl to upload files do not use -d option, use only --data-binary option.

Query-string arguments:

lexer
Type of content
password
Password to restrict access to dump
comment
Comment about dump's content
$ curl --data-binary @secret.txt dumpz.org/api/dump
{
  "url": "http://dumpz.org/2439892/"
  }
Returns JSON response containing URL of created dump

/api/dump/X

GET

Returns content and meta-information about dump X.

Query-string arguments:

password
Password to get access to password-protected dump

$ curl dumpz.org/api/dump/2439892
{
  "comment": "", 
  "updated": "2016-10-04T20:59:23.600947", 
  "created": "2016-10-04T20:59:23.580555", 
  "url": "http://dumpz.org/2439892/", 
  "lexer": "text", 
  "content": "test\n", 
  "user": ""
}

/

PUT

Yeah. That is special case. You can just throw some data with curl to dumpz.org :-) This API method accepts all querystring arguments that /api/dump method accepts.

If you use curl to upload files do not use -d option, use only --data-binary option.

curl -d test dumpz.org
http://dumpz.org/2439829/
$ echo test | curl -d @- dumpz.org
http://dumpz.org/2439829/
$ curl --data-binary @secret.txt dumpz.org
http://dumpz.org/2439829/
Returns text/plain response containing URL of created dump. The response has trailing new-line character to looks pretty in the console.

/api/recent

GET

List of recently uploaded dumps.

Querystring options:

limit
How many items to return. Maximum is 5000
public
If 1, then returns only dumps without password. Most of password-protected dumps are SPAM ;-)
$ curl dumpz.org/api/recent?limit=2
{
  "dumps": [
    {
      "date": "2016-10-04T21:47:32.973500", 
      "pwd": 1, 
      "id": 2439999
    }, 
    {
      "date": "2016-10-04T21:45:11.457512", 
      "pwd": 1, 
      "id": 2439998
    }
  ]
}