Documenation - api.aws3.link



Subscribe on AWS Marketplace
  • 1  Go to our listings page on AWS Marketplace.
  • 2  Subscribe to our Product.
  • 3  On the registration page, enter your account informations and click on 'Continue'.
  • 4  Save your displayed API key somewhere secure.


  • Code samples

    The following code sample creates a short URL with a random key. The link gets expired after 24 hours.


    const https = require("https")
    
    var data = JSON.stringify({
        "longUrl": "https://selenium.cloud/doc/aws/graphical-ubuntu.html#execute",
        "expireHours": 24,
    });
    var options = {
        host: "api.aws3.link",
        path: "/shorten",
        method: 'POST',
        headers: {
            'Content-Type': 'application/json',
            'x-api-key': '<YourApiKey>'
        },
    };
    
    var req = https.request(options, (res) => {
      console.log('statusCode:', res.statusCode);
    
      res.on('data', (d) => {
        process.stdout.write(d);
      });
    });
    
    req.on('error', (e) => {
      console.error(e);
    });
    
    req.write(data);
    req.end();
    import requests
    import json
    
    headers = {
      'x-api-key': '<YourApiKey>',
      'Content-Type': 'application/json'
      }
    body = json.dumps({
      "longUrl": "https://selenium.cloud/doc/aws/graphical-ubuntu.html#execute",
      "expireHours": 24,
    })
    response = requests.post('https://api.aws3.link/shorten', headers=headers, data=body)
    response = response.json()
    print(response)


    API endpoint: Shorten
    URL endpoint: https://api.aws3.link/shorten
    
    Method: POST
    "header": {   "x-api-key": STRING,   "Content-Type": "application/json" }
    "body": {   "longUrl": STRING,   "customKey": STRING,   "expireHours": NUMBER, }
  • Required  "longUrl": The destination URL you want to redirect. Protocol (http, https) needs to be included.
  •  "customKey": Define a custom key ("aws3.link/customKey"). Passing no customKey will generate a random string as key.
  •  "expireHours": Define after how many hours the shortened URL will expire. Needs to be between 1 and 8760 (= 1 year). Default is 0, which means non-expiring link.
  • Response:
    
    "body": {   "shortUrl": STRING,   "metadata": {     "longUrl": STRING,     "key": STRING,     "expiration": DATE,   } }


    API endpoint: Update
    URL endpoint: https://api.aws3.link/update
    
    Method: POST
    "header": {   "x-api-key": STRING,   "Content-Type": "application/json" }
    "body": {   "key": STRING,   "newDestUrl": STRING,   "expireHours": NUMBER, }
  • Required  "key": The key of the short URL you want to update. 'myKey' for an.si/myKey e.g.
  •  "newDestUrl": The updated destination URL you want to redirect. Protocol (http, https) needs to be included.
  •  "expireHours": Define after how many hours the shortened URL will expire. Needs to be between 1 and 8760 (= 1 year). Default is 0, which means non-expiring link.
  • Response:
    
    "body": {   "shortUrl": STRING,   "metadata": {     "longUrl": STRING,     "key": STRING,     "expiration": DATE,   } }


    API endpoint: Remove
    URL endpoint: https://api.aws3.link/remove
    
    Method: POST
    "header": {   "x-api-key": STRING,   "Content-Type": "application/json" }
    "body": {   "key": STRING }
  • Required  "key": The key of the short URL you want to delete. 'myKey' for an.si/myKey e.g.
  • Response:
    
    "body": {   "message": "Provided key has been removed",   "metadata": {     "longUrl": STRING,     "key": STRING   } }