URL Shortener

API

http://s.my-azur.de/api.php?parameters

Anfrageparameter

  • url: (erforderlich) Die zu kürzende URL beginnend mit http://, https:// oder ftp://
  • format: (optional)
    • plain (default) gibt an, dass die Ausgabe als Plain Text erfolgen soll. Es wird nur die URL oder ein Fehlertext ausgegeben.
    • json (empfohlen) gibt an, dass die Ausgabe als JSON (JavaScript Object Notation) erfolgen soll. Es werden status(true), longurl, shortid, shorturl oder im Fehlerfall status(false), longurl und text
  • callback: (optional)

Beispiel PHP

$shortenedurl = file_get_contents('http://s.my-azur.de/api.php?url=http://google.de/');

Beispiel Javascript

$.getJSON('http://s.my-azur.de/api.php?callback=?', {
  url: 'http://google.de/',
  format: 'json'
}, function(res) {
  if(res.status === true) {
    console.log(res.shorturl);
  }
});