Skip to main content

📋 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 createdBy filter is specified, all the links created on the platform are returned by default
Pagination Parameters
ParameterTypeRequiredDefaultDescriptionExample
pageintegerNo1The page number to retrieve (starts from 1)1
sizeintegerNo20Number of items per page (max 100)20
Filter Parameters
ParameterTypeRequiredDefaultDescriptionExample Values
createdBystringNoapi_userFilter links by the type of key used to create themapi_user, api_rest, sdk
CreatedBy Filter Values:
  • api_user - Links created using API user keys
  • api_rest - Links created using REST API keys
  • sdk - 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
FieldTypeDescriptionExample
createdTimestringThe date and time when the link was created (ISO 8601 format)"2025-07-02T10:22:01"
destination_urlstringThe destination URL that the link redirects to"https://yourapp.com/content"
idstringThe unique identifier for the link (UUID format)"4eb66e2e-6acd-4b40-8767-3966ebf7c5a6"
is_enabledbooleanIndicates whether the link is currently enabled or disabledtrue
link_namestringThe name assigned to the link for identification"Summer Sale"
modifiedTimestringThe date and time when the link was last modified (ISO 8601 format)"2025-07-02T10:22:01"
org_idstringThe organization ID to which the link belongs"6867c0be01ed16b7bf180376"
short_urlstringThe shortened URL representing the actual dynamic link"https://yourapp.chottu.link/promo-summer"
Pagination Object Fields
FieldTypeDescriptionExample
current_pageintegerThe current page number in the paginated result set1
page_sizeintegerThe number of items displayed per page20
total_itemsintegerThe total number of items available across all pages2
total_pagesintegerThe total number of pages in the result set1

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"
}
}

Status Code: 200 OK

{
"links": [],
"pagination": {
"current_page": 1,
"page_size": 20,
"total_items": 0,
"total_pages": 0
}
}

Usage Examples​

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();

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​

  1. Start with Default Values: Use page=1 and size=20 for initial requests
  2. Implement Progressive Loading: Load more data as needed
  3. Handle Empty Results: Always check for empty link arrays
  4. Monitor Total Items: Use total_items to show progress indicators
  5. Cache Results: Cache frequently accessed pages

Error Handling Best Practices​

  1. Check HTTP Status Codes: Always verify response status
  2. Handle Network Errors: Implement retry logic for network failures
  3. Validate Response Format: Ensure response structure is as expected
  4. Log Errors: Log API errors for debugging purposes
  5. 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.