0bs.de - API Reference

Links

INFORMATION: There is a rate-limit, so just keep calm a bit.

GET /api/getLink/{id} Returns all informations about the given link

Parameters

Parameter name Value Description
id \w+ ID parameter

Usage

Request
curl -X GET 'https://0bs.de/api/getLink/aN'
Output

{
  "id": "aN",
  "urlShortened": "http://example.com",
  "createDate": "2014-07-01 21:56:10",
  "expireDate": null,
  "fullURL": "https://0bs.de/aN",
  "error": false,
  "status": 200
}
Request
curl -X GET 'https://0bs.de/api/getLink/eeeeeee'
Output

{
  "error": true,
  "msg": "Link has not been found",
  "status": 404
}

GET /api/getQrCode/{id} Returns the QR-Code Image for the given link

Parameters

Parameter name Value Description
id \w+ ID parameter

Usage

Request
curl -X GET 'https://0bs.de/api/getQrCode/aN'
Output
qr-code-example
Data for PNG-image is returned, added in here with img-tag.
Request
curl -X GET 'https://0bs.de/api/getQrCode/eeeeeee'
Output

{
  "error": true,
  "msg": "Link has not been found",
  "status": 404
}

PUT /api/addLink Saves the given link and creates a shortened URL

Parameters

Parameter name Value Description
url \s+ Valid URL in following format: http://subdomain.domain.com

Usage

Request
curl -X PUT 'https://0bs.de/api/addLink' -d 'url=http://subdomain.domain.com'
Output

{
  "id": "bsp",
  "urlShortened": "http://subdomain.domain.com/",
  "createDate": "2014-07-01 22:33:54",
  "expireDate": null,
  "fullURL": "https://0bs.de/bsp", 
  "error": false,
  "status": 201
}

Status: 201 - new link created, 200 existing link returned
Request
curl -X PUT 'https://0bs.de/api/addLink' -d 'url=notlink'
Output

{
  "error": true,
  "msg": "Provided url is not in a valid form",
  "status": 400
}