API - Links

/link/shorten

Creates (if necessary) and returns a shorten.li link from the link in parameter .

Parameters

Notes

Return Values

For example

Address: http://api.shorten.li
GET /link/shorten?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&long_url=http%3A%2F%2Fwww.google.com%2Fmaps
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "new_hash": 1,
      "restored_hash": 0
    }
  ]
}

/link/info

Returns information from one or more shorten.li links.

Parameters

Notes

Return Values

For example

Address: http://api.shorten.li
GET /link/info?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&short_url=http%3A%2F%2Fshorten.li%2F2Bi&short_url=http%3A%2F%2Fshorten.li%2F34cd
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "error": null,
      "title": "Google Maps",
      "clicks": 189,
      "created_at": 1374339536,
      "deleted_at": null
    },
    {
      "short_url": "http:\/\/shn.li\/23cd",
      "error": "NOT_FOUND",
      "title": null,
      "clicks": null,
      "created_at": null,
      "deleted_at": null
    }
  ]
}

/link/edit

Publishes a shorten.li link.

Parameters

Notes

Return Values

For example

Address: http://api.shorten.li
GET /link/edit?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&short_url=http%3A%2F%2Fshorten.li%2F2Bi&long_url=http%3A%2F%2Fbing.com
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "error": null
    }
  ]
}

/link/delete

Removes a link shorten.li ( not permanently ).

Parameters

Return Values

For example

Address: http://api.shorten.li
GET /link/delete?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&short_url=http%3A%2F%2Fshorten.li%2F2Bi
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "error": null
    }
  ]
}

/link/deleted

Returns the last links shorten.li deleted.

Parameters

Notes

Return Values

For example

Address: http://api.shorten.li
GET /link/deleted?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "error": "DELETED_BY_USER",
      "deleted_at": 1374368721,
      "clicks": 279,
      "created_at": 1374339536
    }
  ]
}

/link/restore

Restores a link shorten.li deleted by the user.

Parameters

Return Values

For example

Address: http://api.shorten.li
GET /link/restore?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&short_url=http%3A%2F%2Fshorten.li%2F2Bi
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "error": null
    }
  ]
}

/link/expand

Returns links associated with links shorten.li passed as parameters .

Parameters

Notes

Return Values

For example

Address: http://api.shorten.li
GET /link/expand?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&short_url=http%3A%2F%2Fshorten.li%2F2Bi
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "error": null,
      "long_url": "http:\/\/bing.com"
    }
  ]
}

/link/lookup

Returns shorten.li links from the links passed as parameters .

Parameters

Notes

Return Values

For example

Address: http://api.shorten.li
GET /link/lookup?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&long_url=http://bing.com
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "long_url": "http:\/\/bing.com",
      "error": null,
      "short_url": "http:\/\/shn.li\/2Bi"
    }
  ]
}

/link/last

Retourne les derniers links shorten.li créés.

Parameters

Notes

Return Values

For example

Address: http://api.shorten.li
GET /link/last?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&limit=2
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "clicks": 314,
      "error": null,
      "created_at": 1374339536
    },
    {
      "short_url": "http:\/\/shn.li\/1234",
      "clicks": 357,
      "error": null,
      "created_at": 1373251217
    }
  ]
}

/link/top

Returns shorten.li links the most popular.

Parameters

Notes

Return Values

For example

Address: http://api.shorten.li
GET /link/top?uid=VOTRE_ID&secret_key=VOTRE_CLE_SECRETE&limit=2
{
  "status_code": 200,
  "status_txt": "OK",
  "data": [
    {
      "short_url": "http:\/\/shn.li\/1234",
      "clicks": 357,
      "error": null,
      "created_at": 1373251217
    },
    {
      "short_url": "http:\/\/shn.li\/2Bi",
      "clicks": 314,
      "error": "DELETED_BY_USER",
      "created_at": 1374339536
    }
  ]
}