Subscribe on AWS Marketplace
Code samples
API endpoint: Shorten
API endpoint: Remove
API endpoint: Track
Custom Domain Integration
1. Go to our listings page on AWS Marketplace.
2. Click on 'View purchase options' and 'Set up your account' to subscribe to our product.
3 Enter your account information on the registration page and click on 'Continue'.
4 Save the API key displayed on the page in a secure location.
Below is a code sample that creates a short URL with a random key. The link automatically expires after 24 hours.
var client = new RestClient("https://api.aws3.link/shorten");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<YourApiKey>");
request.AddHeader("Content-Type", "application/json");
var body = @"{" + "\n" +
@" ""longUrl"": ""https://www.silverlining.cloud/docs/aws/aws3""," + "\n" +
@" ""expireHours"": 24" + "\n" +
@"}";
request.AddParameter("application/json", body, ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
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,
"keyLength": NUMBER,
"customDomain": STRING
}
Required
"longUrl": The destination URL you want to redirect to. The protocol (http or https) must be included.
Optional
"customKey": Define a custom key for the shortened URL (e.g., "aws3.link/customKey"). If no custom key is provided, a random string will be generated as the key.
"expireHours": Set the expiration time for the shortened URL (in hours). The value must be between 1 and 8760 (1 year). The default value is 0, which means the link will not expire.
"keyLength": This parameter allows you to define the length of the randomly generated key. It can be set to any value between 4 and 8. If not specified, the default length is set to 6 characters.
"customDomain": Specify the domain name you want to use to shorten your URL. Before using this option, please refer to the "Custom Domain Integration" section below. Please note that we provide the following custom domains that you can use for free: azr.link, goog.link, docn.link, and an.si.
Response:
"body": {
"shortUrl": STRING,
"metadata": {
"longUrl": STRING,
"domain": STRING,
"key": STRING,
"expiration": DATE,
}
}
URL endpoint: https://api.aws3.link/remove
Method: POST
"header": {
"x-api-key": STRING,
"Content-Type": "application/json"
}
"body": {
"key": STRING,
"customDomain": STRING
}
Required
"key": The key of the short URL that you want to delete. For example, if you want to delete "aws3.link/myKey", the key would be "myKey".
Optional
"customDomain": If you are using a custom domain, specify which domain the provided key belongs to.
Response:
"body": {
"message": "Provided key has been removed",
"metadata": {
"longUrl": STRING,
"domain": STRING,
"key": STRING
}
}
URL endpoint: https://api.aws3.link/track
Method: POST
"header": {
"x-api-key": STRING,
"Content-Type": "application/json"
}
"body": {
"key": STRING,
"customDomain": STRING
}
Required
"key": The key of the short URL that you want to track. For example, if you want to track "aws3.link/myKey", the key would be "myKey".
Optional
"customDomain": If you are using a custom domain, specify which domain the provided key belongs to.
Response:
"body": {
"totalHits": NUMBER,
"hits": [{
"date": DATE,
"time": TIME,
"ip": STRING,
"method": STRING,
"resource": STRING,
"referrer": STRING,
"user": {
"platform": {
"name": STRING,
"version": STRING,
},
"os": {
"name": STRING,
},
"bot": BOOLEAN,
"flavour": {
"name": STRING,
"version": STRING,
},
"browser": {
"name": STRING,
"version": STRING
}
},
"rawUserAgent": STRING,
"timeTaken": FLOAT
}],
"metadata": {
"longUrl": STRING,
"domain": STRING,
"key": STRING
}
}
"totalHits": The total number of successfully registered clicks for the shortened URL.
"hits: A list of the actual clicks on the shortened URL. Each click includes the date and time that the URL was clicked, the IP address of the click, the referring URL, and detailed information about the user's device.
"metadata": The metadata for the shortened URL, including the long URL, custom domain (if applicable), and key of the request.
You can use your own domain with our API endpoints by subscribing to our custom domain add-on on AWS Marketplace. Once you subscribe, we will configure our backend to support API calls with the "customDomain" parameter at the /shorten, /remove, and /track endpoints. Finally, you will need to point your domain to our service with a CNAME record in your domain's settings.