In order to have access to the API, first of all, you will have to register your email to be able to access the rest of the endpoints. Once you have registered, you will have access to an access token, which will be the one you use to make use of the rest of the calls. The access token is an alphanumeric code that is generated randomly and uniquely for each user.
Eg Token: f2c88207-d594-4df1-94e2-974b32903401
To retrieve the access token you just have to call the following endpoint and pass your email in the Body.
http://bts-shortlink.com/api/v01/auth/get-token{ "email": "[email protected]" }
{
"code": 200,
"message": "OK",
"data": {
"token": "1d123780-acf0-4ac9-9337-2cc4950421ce",
"access_token": "f2c88207-d594-4df1-94e2-974b32903401",
"refresh_token": null,
"type_token": "Bearer"
}
}
Get a list of all the links associated with your email.
http://bts-shortlink.com/api/v01/shortlinks/list
{ "code": 200, "message": "OK", "data": { "user": { "accessToken": "f2c88207-d594-4df1-94e2-974b32903401" }, "urls": [ { "urlToken": "TghEX3yi9XM0MuuZxbtX1nXc5evRrs", "urlShort": "https://pre.bts-shortlink.com/Eq82FitvzA", "urlLong": "https://www.bts-shortlink.com", "urlCount": "12" }, { "urlToken": "TghEX3yi9XM0MuuZxbtX1nXc5evRrs", "urlShort": "https://www.bts-shortlink.com/Eq82FitvzA", "urlLong": "https://www.bts-shortlink.com", "urlCount": "41" } ] } }
Create a link and associate it with your email.
http://bts-shortlink.com/api/v01/shortlinks/create{ "url_long": "https://www.bts-shortlink.com" }
{
"code": 200,
"message": "OK",
"data": {
"user": {
"accessToken": "f2c88207-d594-4df1-94e2-974b32903401"
},
"urls": {
"urlShort": "https://www.bts-shortlink.com/e1CEvQEfAG",
"urlLong": "https://www.bts-shortlink.com"
}
}
}