Creating Short Links / ~#root -i Creating Short Links / ~#root -i Creating Short Links / ~#root -i Creating Short Links / ~#root -i Creating Short Links / ~#root -i Creating Short Links / ~#root -i Creating Short Links / ~#root -i Creating Short Links / ~#root -i
  • RU
  • UA
  • EN
  • Create an online store
  • Documentation
  • Blog
    • Unix ОS
    • Php
    • MySQL
    • JavaScript
    • Package Managers
    • Docker
    • Seo
  • Auxiliary services
    • Short Links
    • Exchange views YouTube
  • Sign in
  • Create Account
  • Home
  • Short Links

Creating Short Links

Free

  • 50 links
  • 7 days of links
  • Support API

Authorization + Free

  • 1000 links
  • 30 days of links
  • Support API

Authorization + 3$/month

  • Unlimited links
  • 180 days of links
  • Support API

Authorization + 5$/month

  • Unlimited links
  • 365 days of links
  • Support API
Links created during the validity of the tariff remain valid even after the end of the tariff (if the tariff has not been renewed).

Working with Short Links API

To work with the API, you need to pay a tariff and get API key in your profile.
Php example: in $ArrayToSend pass api_key & url. Pack in JSON and send POST https://root-i.work/t/api.

$ArrayToSend = [
    'api_key' => 'API key',
    'url' => 'The link to which the redirect will be made (https://site/)',
];

$curl = curl_init();
curl_setopt_array($curl, [
    CURLOPT_URL => 'https://root-i.work/t/api',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_POSTFIELDS => json_encode($ArrayToSend),
    CURLOPT_HTTPHEADER => [
        "Content-Type: application/json",
        "cache-control: no-cache"
    ],
]);

$response = curl_exec($curl);

curl_close($curl);


Answer success:
success - whether the link was created ('true|false')
key - the key created during the redirect (participates in the final link)
full_url - full redirect link (together with the key)

array(3) [
  ["success"]=>
  string(4) "true"
  ["key"]=>
  string(12) "wrb1solnz5xt"
  ["full_url"]=>
  string(34) "https://root-i.work/t/wrb1solnz5xt"
]


Answer error:
success - whether the link was created ('true|false')
message - error message

array(2) [
  ["message"]=>
  string(46) "Cause of error"
  ["success"]=>
  string(5) "false"
]


The data will be given to you in JSON and be careful, when the link expires, it will be deleted.

I share information in which I needed help and spent a lot of time figuring it out. If the information helped at least one person, then this site was not created in vain.

Thank you for the continuation of the site:
Contacts

Telegram Viber Mail

Search for articles

  • Sign in
  • Create Account

Powered by chmod -R