To start using the API you need an API key. Please login to generate an API key.

Uploading

HTTP POST to https://bin.jvnv.net/api/upload with the file to be uploaded in the file field. The regular URL https://bin.jvnv.net/upload can also be used, but files uploaded via this URL can't be registered to your account as this requires a valid browser session.

cURL example:

$ curl -F file=@image.png https://bin.jvnv.net/api/upload
Returns the following JSON, which should be self-explanatory:
{
  "hash": "hash",
  "status": true,
  "urls": {
    "base": "https://bin.jvnv.net/file/",
    "full": "https://bin.jvnv.net/file/hash/image.png",
    "ext": "https://bin.jvnv.net/file/hash.png",
    "hash": "https://bin.jvnv.net/file/hash"
  }
}

To register files to your account, the API key must be specified as the bearer token:

$ curl -H 'Authorization: Bearer api_key' -F file=@image.png https://bin.jvnv.net/api/upload
(Replace api_key with a generated API key)

Legacy upload API

By using the regular URL and adding api=1 you will get machine-readable responses in the form: response result where response is either ERROR or OK, and result is the file hash in the case of OK, or an error message in the case of ERROR. The hash can be used to construct URLs in which the paths begin with /file/hash where hash is the hash received.

Any file extension an be appended to the hash, and for convenience the original filename (or whatever filename you prefer) can be appended after an additional slash after the hash. See JSON response above for examples on how to construct URLs.