Skip to main content

📱 Get Install Analytics via REST API

Use ChottuLink's REST API to retrieve install analytics data for your dynamic links. This endpoint provides detailed install statistics including total installs, 7-day installs, and 30-day installs for any specific link in your account. This feature requires a paid subscription plan.

Endpoint​

POST https://api2.chottulink.com/chotuCore/pa/v1/install-analytics
Production Endpoint

The production endpoint may differ from the staging URL shown above. Please verify the correct endpoint URL for your environment.

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.

Request Parameters​

Parameter Guidelines:
  • You must provide either shortUrl or linkId
  • Both parameters cannot be empty
  • Use shortUrl for easier identification
  • Use linkId for programmatic access
  • This feature requires a paid subscription plan
Install Analytics Parameters
ParameterTypeRequiredDescriptionExample
shortUrlstringNo*The short URL of the link to get install analytics forhttps://url.com/dummy
linkIdstringNo*The unique ID of the link to get install analytics ford15ca68a-397e-4f8b-8e38-4e9cba7bfth56

*Either shortUrl or linkId must be provided

Example Request​

Using Short URL​

curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/install-analytics' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"shortUrl": "https://url.com/dummy"
}'
curl --location 'https://api2.chottulink.com/chotuCore/pa/v1/install-analytics' \
--header 'API-KEY: c_api_xxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"linkId": "d15ca68a-397e-4f8b-8e38-4e9cba7bfth56"
}'

Response​

Success Response​

Status Code: 200 OK

{
"installs_last_30_days": 0,
"installs_last_7_days": 0,
"total_installs": 0
}

Response Fields​

Install Analytics Object Fields
FieldTypeDescriptionExample
installs_last_30_daysintegerNumber of installs recorded in the last 30 days from the current date0
installs_last_7_daysintegerNumber of installs recorded in the last 7 days from the current date0
total_installsintegerTotal number of installs recorded for the link since it was created0

Error Responses​

Missing Parameters​

Status Code: 400 Bad Request

{
"code": 101,
"errorMessage": "There was one or more validation error(s)",
"errors": [
{
"errorMessage": "REQUIRED_FIELD_MISSING",
"fieldName": "Both 'shortUrl' and 'linkId' cannot be empty. At least one must be provided."
}
]
}
note

This error occurs when one or more required inputs are missing from the request.

Unauthorized Access​

Status Code: 401 Unauthorized

{
"code": 130,
"errorMessage": "Authorization Failed!",
"error": {
"errorMessage": "'API-KEY' missing",
"fieldName": "UNAUTHORIZED_ACCESS"
}
}
note

This error occurs when the user does not send the API-KEY in the request headers.

Access Denied - Subscription Required​

Status Code: 403 Forbidden

{
"code": 115,
"errorMessage": "Access Denied",
"error": {
"errorMessage": "UNAUTHORIZED_ACCESS",
"fieldName": "Not a valid subscription to access install analytics. Please upgrade your subscription to unlock this feature."
}
}
Subscription Required

This error occurs when the user has not subscribed to a paid plan or does not have an active subscription. Install analytics is a premium feature that requires an active paid subscription.

Usage Examples​

const axios = require('axios');

async function getInstallAnalytics(shortUrl) {
try {
const response = await axios.post(
'https://api2.chottulink.com/chotuCore/pa/v1/install-analytics',
{
shortUrl: shortUrl
},
{
headers: {
'API-KEY': 'c_api_xxxxxxxxxxxxxxxxxxxx',
'Content-Type': 'application/json'
}
}
);

return response.data;
} catch (error) {
if (error.response?.status === 403) {
console.error('Install analytics requires a paid subscription');
}
console.error('Error fetching install analytics:', error.response?.data || error.message);
throw error;
}
}

// Usage
getInstallAnalytics('https://url.com/dummy').then(data => {
console.log('Total installs:', data.total_installs);
console.log('Last 7 days:', data.installs_last_7_days);
console.log('Last 30 days:', data.installs_last_30_days);
});

Best Practices​

Implementation Tips:
  • Parameter Validation: Always validate that either shortUrl or linkId is provided
  • Error Handling: Implement proper error handling for all response codes, especially 403 for subscription checks
  • Subscription Check: Verify your subscription status before attempting to use this endpoint
  • Caching: Cache install analytics data when appropriate to reduce API calls
  • Rate Limiting: Respect API rate limits and implement exponential backoff
  • Data Validation: Validate response data before processing

Install Analytics Best Practices​

  1. Choose the Right Parameter: Use shortUrl for human-readable identification, linkId for programmatic access
  2. Handle Zero Installs: Always handle cases where installs are 0
  3. Monitor Trends: Track install analytics over time to identify patterns
  4. Cache Results: Cache install analytics data for frequently accessed links
  5. Error Recovery: Implement retry logic for network failures, but respect 403 errors (subscription required)

Error Handling Best Practices​

  1. Check HTTP Status Codes: Always verify response status
  2. Handle Subscription Errors: Specifically handle 403 errors to inform users about subscription requirements
  3. Handle Network Errors: Implement retry logic for network failures
  4. Validate Response Format: Ensure response structure is as expected
  5. Log Errors: Log API errors for debugging purposes
  6. User-Friendly Messages: Provide meaningful error messages to users, especially for subscription-related errors

Rate Limits​

The API is subject to rate limiting. Please contact support for specific rate limit information.

Subscription Requirements​

Premium Feature

Install analytics is a premium feature that requires an active paid subscription. If you receive a 403 Forbidden error, please upgrade your subscription plan to access this feature.