📋 List Dynamic Links via REST API
Use ChottuLink's REST API to retrieve all dynamic links associated with your organization. This endpoint provides paginated access to both active and disabled links, making it ideal for dashboard integrations, link management systems, or bulk operations.
Endpoint​
GET https://api2.chottulink.com/chotuCore/pa/v1/links/page
Authentication​
Include your API key in the request header:
API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
API Key Replacement Required
Replace c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your actual REST API integration key from
the ChottuLink Dashboard.
Query Parameters​
Parameter Guidelines:
- All parameters are optional
- Default values provide sensible defaults for most use cases
- Pagination starts from page 1 (not 0)
- Maximum page size is typically 100 items per page
- When no
createdByfilter is specified, all the links created on the platform are returned by default
Pagination Parameters
| Parameter | Type | Required | Default | Description | Example |
|---|---|---|---|---|---|
| page | integer | No | 1 | The page number to retrieve (starts from 1) | 1 |
| size | integer | No | 20 | Number of items per page (max 100) | 20 |
Filter Parameters
| Parameter | Type | Required | Default | Description | Example Values |
|---|---|---|---|---|---|
| createdBy | string | No | api_user | Filter links by the type of key used to create them | api_user, api_rest, sdk |
CreatedBy Filter Values:
api_user- Links created using API user keysapi_rest- Links created using REST API keyssdk- Links created using SDK keys
Example Request​
Basic Request (Default Pagination)​
curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/links/page' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Request with Custom Pagination​
curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=1&size=20' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Request with Large Page Size​
curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=1&size=50' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Request with CreatedBy Filter​
curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/links/page?createdBy=api_rest' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Request with All Parameters​
curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=1&size=50&createdBy=sdk' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
Response​
Success Response​
Status Code: 200 OK
{
"links": [
{
"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"
},
{
"createdTime": "2025-05-02T12:46:19",
"destination_url": "https://yourapp.com/",
"id": "3e15d5e5-fe81-4714-a846-30245d3d3445",
"is_enabled": true,
"link_name": "Share App",
"modifiedTime": "2025-05-04T08:33:42",
"org_id": "6867c0be01ed16b7bf180376",
"short_url": "https://yourapp.chottu.link/share"
}
],
"pagination": {
"current_page": 1,
"page_size": 20,
"total_items": 2,
"total_pages": 1
}
}
Response Fields​
Link Object Fields
| Field | Type | Description | Example |
|---|---|---|---|
| createdTime | string | The date and time when the link was created (ISO 8601 format) | "2025-07-02T10:22:01" |
| destination_url | string | The destination URL that the link redirects to | "https://yourapp.com/content" |
| id | string | The unique identifier for the link (UUID format) | "4eb66e2e-6acd-4b40-8767-3966ebf7c5a6" |
| is_enabled | boolean | Indicates whether the link is currently enabled or disabled | true |
| link_name | string | The name assigned to the link for identification | "Summer Sale" |
| modifiedTime | string | The date and time when the link was last modified (ISO 8601 format) | "2025-07-02T10:22:01" |
| org_id | string | The organization ID to which the link belongs | "6867c0be01ed16b7bf180376" |
| short_url | string | The shortened URL representing the actual dynamic link | "https://yourapp.chottu.link/promo-summer" |
Pagination Object Fields
| Field | Type | Description | Example |
|---|---|---|---|
| current_page | integer | The current page number in the paginated result set | 1 |
| page_size | integer | The number of items displayed per page | 20 |
| total_items | integer | The total number of items available across all pages | 2 |
| total_pages | integer | The total number of pages in the result set | 1 |
Error Responses​
Unauthorized Access​
Status Code: 401 Unauthorized
{
"code": 130,
"errorMessage": "Authorization Failed!",
"error": {
"errorMessage": "Invalid Api Key",
"fieldName": "UNAUTHORIZED_ACCESS"
}
}
Invalid Pagination Parameters​
Status Code: 400 Bad Request
{
"code": 400,
"errorMessage": "Invalid pagination parameters",
"error": {
"errorMessage": "Page size must be between 1 and 100",
"fieldName": "size"
}
}
No Links Found​
Status Code: 200 OK
{
"links": [],
"pagination": {
"current_page": 1,
"page_size": 20,
"total_items": 0,
"total_pages": 0
}
}
Usage Examples​
- Java
- Javascript
- Node.js
- Python
- Php
- Dart
- Kotlin
- Swift
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=1&size=20")
.method("GET", body)
.addHeader("API-KEY", "c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build();
Response response = client.newCall(request).execute();
const myHeaders = new Headers();
myHeaders.append("API-KEY", "c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
const requestOptions = {
method: "GET",
headers: myHeaders,
redirect: "follow"
};
fetch("https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=1&size=20", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
const axios = require('axios');
async function getLinks(page = 1, size = 20) {
try {
const response = await axios.get(
`https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=${ page }&size=${ size }`,
{
headers: {
'API-KEY': 'c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
}
);
return response.data;
} catch (error) {
console.error('Error fetching links:', error.response?.data || error.message);
throw error;
}
}
// Usage
getLinks(1, 20).then(data => {
console.log('Links:', data.links);
console.log('Pagination:', data.pagination);
});
import requests
def get_links(page=1, size=20):
url = f"https://api2.chottulink.com/chotuCore/pa/v1/links/page?page={page}&size={size}"
headers = {
'API-KEY': 'c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
}
try:
response = requests.get(url, headers=headers)
response.raise_for_status()
return response.json()
except requests.exceptions.RequestException as e:
print(f"Error fetching links: {e}")
raise
# Usage
data = get_links(1, 20)
print("Links:", data['links'])
print("Pagination:", data['pagination'])
<?php
function getLinks($page = 1, $size = 20) {
$url = "https://api2.chottulink.com/chotuCore/pa/v1/links/page?page={$page}&size={$size}";
$headers = [
'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
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 fetching links: HTTP {$httpCode}");
}
}
// Usage
try {
$data = getLinks(1, 20);
echo "Links: " . json_encode($data['links']) . "\n";
echo "Pagination: " . json_encode($data['pagination']) . "\n";
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . "\n";
}
?>
var headers = {
'API-KEY': 'c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
};
var request = http.Request('GET', Uri.parse('https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=1&size=20'));
request.headers.addAll(headers);
http.StreamedResponse response = await request.send();
if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
val client = OkHttpClient()
val request = Request.Builder()
.url("https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=1&size=20")
.addHeader("API-KEY", "c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx")
.build()
val response = client.newCall(request).execute()
var request = URLRequest(url: URL(string: "https://api2.chottulink.com/chotuCore/pa/v1/links/page?page=1&size=20")!,timeoutInterval: Double.infinity)
request.addValue("c_api_xxxxxxxxxxxxxxxxxxxxxxxxxxxxx", forHTTPHeaderField: "API-KEY")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Best Practices​
Implementation Tips:
- Pagination Strategy: Implement proper pagination handling in your application
- Caching: Cache link data when appropriate to reduce API calls
- Error Handling: Always handle potential API errors gracefully
- Rate Limiting: Respect API rate limits and implement exponential backoff
- Data Validation: Validate response data before processing
Pagination Best Practices​
- Start with Default Values: Use page=1 and size=20 for initial requests
- Implement Progressive Loading: Load more data as needed
- Handle Empty Results: Always check for empty link arrays
- Monitor Total Items: Use total_items to show progress indicators
- Cache Results: Cache frequently accessed pages
Error Handling Best Practices​
- Check HTTP Status Codes: Always verify response status
- Handle Network Errors: Implement retry logic for network failures
- Validate Response Format: Ensure response structure is as expected
- Log Errors: Log API errors for debugging purposes
- User-Friendly Messages: Provide meaningful error messages to users
Rate Limits​
The API is subject to rate limiting. Please contact support for specific rate limit information.