🔍 Get Link Information by ShortUrl
Use ChottuLink's REST API to retrieve detailed information about a specific dynamic link using its short URL. This public API endpoint allows you to fetch link metadata including destination URL, creation time, link name, and enabled status - perfect for integrating link data into external systems or dashboards.
Endpoint
POST https://api2.chottulink.com/chotuCore/pa/v1/links/info
Authentication
Include your API key in the request header:
API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Replace c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your actual REST API integration key from
the ChottuLink Dashboard.
Request Parameters
- The
shortUrlparameter is mandatory - The short URL must be associated with your organization
- The short URL must include the full URL format (including protocol)
- Empty or invalid short URLs will result in a 400 error
Required Parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| shortUrl | string | Yes | The complete short URL of the link you want to retrieve info for | https://yourapp.chottu.link/promo-summer |
Example Request
Basic Request
curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/links/info' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"shortUrl":"https://yourapp.chottu.link/promo-summer"
}'
Response
Success Response
Status Code: 200 OK
{
"createdTime": "2025-07-02T10:22:01",
"destination_url": "https://yourapp.com/content",
"id": "4eb66e2e-6acd-4b40-8767-3966ebf7c5a6",
"is_enabled": true,
"link_name": "Summer Sale",
"modifiedTime": "2025-07-02T10:22:01",
"org_id": "6867c0be01ed16b7bf180376",
"short_url": "https://yourapp.chottu.link/promo-summer"
}
Response Fields
| Field | Type | Description |
|---|---|---|
| createdTime | string | Created date time of the link |
| destination_url | string | Destination URL of the provided short URL |
| id | string | ID of the link |
| is_enabled | boolean | Is link enabled or not, represent boolean value |
| link_name | string | Name of the link |
| modifiedTime | string | Modified date time of the link |
| org_id | string | Organization ID |
| short_url | string | Short URL of the link |
Error Responses
Empty Short URL
Status Code: 400 Bad Request
{
"code": 101,
"errorMessage": "There was one or more validation error(s)",
"error": {
"errorMessage": "shortUrl can not be null and empty!",
"fieldName": "INVALID_VALUE"
}
}
This error occurs when the request is sent with an empty or missing shortUrl field.
Short URL Not Found
Status Code: 400 Bad Request
{
"code": 139,
"errorMessage": "Client Error",
"error": {
"errorMessage": "CLIENT_ERROR",
"fieldName": "{\"detail\":\"Link with short_url 'api3.maeight.com/cron' not found for organization '687f8d35064fe1799bfe5ab8'.\"}"
}
}
This error occurs when the provided short URL doesn't exist in the system or isn't associated with your organization.
Unauthorized API Key
Status Code: 401 Unauthorized
{
"code": 130,
"errorMessage": "Authorization Failed!",
"error": {
"errorMessage": "'API-KEY' missing",
"fieldName": "UNAUTHORIZED_ACCESS"
}
}
This error occurs when the provided API key is missing, invalid, expired, or not included in the request headers.
Usage Examples
- cURL
- Javascript
- Node.js
- Python
- PHP
- Java
- Kotlin
- Swift
- Dart
curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/links/info' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"shortUrl": "https://yourapp.chottu.link/promo-summer"
}'
const myHeaders = new Headers();
myHeaders.append("API-KEY", "c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
myHeaders.append("Content-Type", "application/json");
const requestBody = JSON.stringify({
"shortUrl": "https://yourapp.chottu.link/promo-summer"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: requestBody,
redirect: "follow"
};
fetch("https://api2.chottulink.com/chotuCore/pa/v1/links/info", requestOptions)
.then((response) => response.json())
.then((result) => {
console.log("Link Information:", result);
console.log("Destination URL:", result.destination_url);
console.log("Is Enabled:", result.is_enabled);
})
.catch((error) => console.error("Error:", error));
const axios = require('axios');
async function getLinkInfo(shortUrl) {
try {
const response = await axios.post(
'https://api2.chottulink.com/chotuCore/pa/v1/links/info',
{
shortUrl: shortUrl
},
{
headers: {
'API-KEY': 'c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Type': 'application/json'
}
}
);
return response.data;
} catch (error) {
if (error.response) {
console.error('Error Status:', error.response.status);
console.error('Error Data:', error.response.data);
} else {
console.error('Error:', error.message);
}
throw error;
}
}
// Usage
getLinkInfo('https://yourapp.chottu.link/promo-summer')
.then(linkInfo => {
console.log('Link Information:', linkInfo);
console.log('Created:', linkInfo.createdTime);
console.log('Destination:', linkInfo.destination_url);
})
.catch(err => console.error('Failed to get link info:', err));
import requests
import json
def get_link_info(short_url):
url = "https://api2.chottulink.com/chotuCore/pa/v1/links/info"
headers = {
'API-KEY': 'c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Type': 'application/json'
}
payload = {
"shortUrl": short_url
}
try:
response = requests.post(url, headers=headers, json=payload)
response.raise_for_status()
return response.json()
except requests.exceptions.HTTPError as e:
print(f"HTTP Error: {e}")
print(f"Response: {response.text}")
raise
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
raise
# Usage
try:
link_info = get_link_info('https://yourapp.chottu.link/promo-summer')
print("Link Information:", json.dumps(link_info, indent=2))
print(f"Destination URL: {link_info['destination_url']}")
print(f"Is Enabled: {link_info['is_enabled']}")
print(f"Link Name: {link_info['link_name']}")
except Exception as e:
print(f"Failed to get link info: {e}")
<?php
function getLinkInfo($shortUrl) {
$url = "https://api2.chottulink.com/chotuCore/pa/v1/links/info";
$headers = [
'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Type: application/json'
];
$payload = json_encode([
'shortUrl' => $shortUrl
]);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode === 200) {
return json_decode($response, true);
} else {
throw new Exception("Error getting link info: HTTP {$httpCode} - {$response}");
}
}
// Usage
try {
$linkInfo = getLinkInfo('https://yourapp.chottu.link/promo-summer');
echo "Link Information:\n";
echo json_encode($linkInfo, JSON_PRETTY_PRINT) . "\n";
echo "Destination URL: " . $linkInfo['destination_url'] . "\n";
echo "Is Enabled: " . ($linkInfo['is_enabled'] ? 'Yes' : 'No') . "\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}
?>
import okhttp3.*;
import org.json.JSONObject;
import java.io.IOException;
public class LinkInfoExample {
public static JSONObject getLinkInfo(String shortUrl) throws IOException {
OkHttpClient client = new OkHttpClient();
MediaType JSON = MediaType.parse("application/json; charset=utf-8");
JSONObject requestBody = new JSONObject();
requestBody.put("shortUrl", shortUrl);
RequestBody body = RequestBody.create(requestBody.toString(), JSON);
Request request = new Request.Builder()
.url("https://api2.chottulink.com/chotuCore/pa/v1/links/info")
.post(body)
.addHeader("API-KEY", "c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.addHeader("Content-Type", "application/json")
.build();
try (Response response = client.newCall(request).execute()) {
if (!response.isSuccessful()) {
throw new IOException("Unexpected code " + response);
}
String responseBody = response.body().string();
return new JSONObject(responseBody);
}
}
public static void main(String[] args) {
try {
JSONObject linkInfo = getLinkInfo("https://yourapp.chottu.link/promo-summer");
System.out.println("Link Information: " + linkInfo.toString(2));
System.out.println("Destination URL: " + linkInfo.getString("destination_url"));
System.out.println("Is Enabled: " + linkInfo.getBoolean("is_enabled"));
} catch (Exception e) {
System.err.println("Error: " + e.getMessage());
e.printStackTrace();
}
}
}
import okhttp3.*
import okhttp3.MediaType.Companion.toMediaType
import okhttp3.RequestBody.Companion.toRequestBody
import org.json.JSONObject
import java.io.IOException
class LinkInfoExample {
private val client = OkHttpClient()
private val JSON = "application/json; charset=utf-8".toMediaType()
fun getLinkInfo(shortUrl: String): JSONObject {
val requestBody = JSONObject()
requestBody.put("shortUrl", shortUrl)
val body = requestBody.toString().toRequestBody(JSON)
val request = Request.Builder()
.url("https://api2.chottulink.com/chotuCore/pa/v1/links/info")
.post(body)
.addHeader("API-KEY", "c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.addHeader("Content-Type", "application/json")
.build()
client.newCall(request).execute().use { response ->
if (!response.isSuccessful) {
throw IOException("Unexpected code $response")
}
val responseBody = response.body?.string() ?: throw IOException("Empty response")
return JSONObject(responseBody)
}
}
}
// Usage
fun main() {
val example = LinkInfoExample()
try {
val linkInfo = example.getLinkInfo("https://yourapp.chottu.link/promo-summer")
println("Link Information: ${linkInfo.toString(2)}")
println("Destination URL: ${linkInfo.getString("destination_url")}")
println("Is Enabled: ${linkInfo.getBoolean("is_enabled")}")
} catch (e: Exception) {
println("Error: ${e.message}")
e.printStackTrace()
}
}
import Foundation
func getLinkInfo(shortUrl: String, completion: @escaping (Result<[String: Any], Error>) -> Void) {
guard let url = URL(string: "https://api2.chottulink.com/chotuCore/pa/v1/links/info") else {
completion(.failure(NSError(domain: "Invalid URL", code: -1, userInfo: nil)))
return
}
var request = URLRequest(url: url)
request.httpMethod = "POST"
request.addValue("c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", forHTTPHeaderField: "API-KEY")
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
let requestBody: [String: Any] = [
"shortUrl": shortUrl
]
do {
request.httpBody = try JSONSerialization.data(withJSONObject: requestBody)
} catch {
completion(.failure(error))
return
}
let task = URLSession.shared.dataTask(with: request) { data, response, error in
if let error = error {
completion(.failure(error))
return
}
guard let data = data else {
completion(.failure(NSError(domain: "No data received", code: -1, userInfo: nil)))
return
}
do {
if let json = try JSONSerialization.jsonObject(with: data) as? [String: Any] {
completion(.success(json))
}
} catch {
completion(.failure(error))
}
}
task.resume()
}
// Usage
getLinkInfo(shortUrl: "https://yourapp.chottu.link/promo-summer") { result in
switch result {
case .success(let linkInfo):
print("Link Information:", linkInfo)
if let destinationUrl = linkInfo["destination_url"] as? String {
print("Destination URL:", destinationUrl)
}
if let isEnabled = linkInfo["is_enabled"] as? Bool {
print("Is Enabled:", isEnabled)
}
case .failure(let error):
print("Error:", error.localizedDescription)
}
}
import 'dart:convert';
import 'package:http/http.dart' as http;
Future<Map<String, dynamic>> getLinkInfo(String shortUrl) async {
final url = Uri.parse('https://api2.chottulink.com/chotuCore/pa/v1/links/info');
final headers = {
'API-KEY': 'c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
'Content-Type': 'application/json',
};
final body = jsonEncode({
'shortUrl': shortUrl,
});
try {
final response = await http.post(url, headers: headers, body: body);
if (response.statusCode == 200) {
return jsonDecode(response.body);
} else {
throw Exception('Failed to get link info: ${response.statusCode} - ${response.body}');
}
} catch (e) {
throw Exception('Error getting link info: $e');
}
}
// Usage
void main() async {
try {
final linkInfo = await getLinkInfo('https://yourapp.chottu.link/promo-summer');
print('Link Information: ${jsonEncode(linkInfo)}');
print('Destination URL: ${linkInfo['destination_url']}');
print('Is Enabled: ${linkInfo['is_enabled']}');
print('Link Name: ${linkInfo['link_name']}');
} catch (e) {
print('Error: $e');
}
}
Best Practices
- Validate Short URLs: Always validate the short URL format before making the request
- Error Handling: Implement comprehensive error handling for all possible HTTP status codes
- Caching: Consider caching link information to reduce API calls for frequently accessed links
- Rate Limiting: Respect API rate limits and implement exponential backoff for retries
- Logging: Log API requests and responses for debugging and monitoring purposes
Rate Limits
The API is subject to rate limiting. Please contact support for specific rate limit information for your account.