Good software is always opening its api to others.
Here are the APIs that power this u2b.eu
, you can just use them in your software or even build your own URL shorter.
- Adress:
/{shortened}
- Description: redirect short url to corresponding long url.
- Method:
GET
field | type | detail |
---|---|---|
shorten | string | From url, shortened URL. |
Targeted URL is included in location
headers, no response body.
- Adress:
/
- Description: shorten a long url, use
body
to pass parameters. - Method:
PUT
field | type | detail |
---|---|---|
urls | string | Long URL to shorten |
{
"code": 201, // error code
"data": {
"shortUrl": "https://u2b.eu/xxx", // shortened url
"revokePwd": "aabbccdd" // revoke password
}
}
- Adress:
/{shortened}?revokePwd={revokepwd}
- Description: Revoke a URL.
- Method:
DELETE
field | type | detail |
---|---|---|
shorten | string | From url, shortened URL. |
revokepwd | string | From query, revoke password. |
{
"code": 201,
"msg": "Deleted"
}