The createQrCodeHandler creates a qr code for the input body and returns the reponse to users
curl -X POST \
'https://apis.divsly.com/api/v1/analytics' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN_HERE' \
-H 'Content-Type: application/json' \
-d '{
"shortlink": "https://kut.lt/d3i1t?r=qr",
"startDate": "2024-03-01",
"endDate": "2024-03-25",
"plan": "STARTER",
"linkAnalytics": 5,
"kind": "country"
}'
fetch('https://apis.divsly.com/api/v1/analytics', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE',
'Content-Type': 'application/json'
},
body: JSON.stringify({
shortlink: 'https://kut.lt/d3i1t?r=qr',
startDate: '2024-03-01',
endDate: '2024-03-25',
plan: 'STARTER',
linkAnalytics: 5,
kind: 'country'
})
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const axios = require('axios');
axios.post(
'https://apis.divsly.com/api/v1/analytics',
{
shortlink: 'https://kut.lt/d3i1t?r=qr',
startDate: '2024-03-01',
endDate: '2024-03-25',
plan: 'STARTER',
linkAnalytics: 5,
kind: 'country'
},
{
headers: {
Authorization: 'Bearer YOUR_JWT_TOKEN_HERE',
'Content-Type': 'application/json'
}
}
)
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error.response?.data || error.message);
});
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => 'https://apis.divsly.com/api/v1/analytics',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer YOUR_JWT_TOKEN_HERE',
'Content-Type: application/json'
],
CURLOPT_POSTFIELDS => json_encode([
'shortlink' => 'https://kut.lt/d3i1t?r=qr',
'startDate' => '2024-03-01',
'endDate' => '2024-03-25',
'plan' => 'STARTER',
'linkAnalytics' => 5,
'kind' => 'country'
])
]);
$response = curl_exec($curl);
if (curl_errno($curl)) {
echo 'Error: ' . curl_error($curl);
} else {
echo $response;
}
curl_close($curl);
import requests
url = "https://apis.divsly.com/api/v1/analytics"
payload = {
"shortlink": "https://kut.lt/d3i1t?r=qr",
"startDate": "2024-03-01",
"endDate": "2024-03-25",
"plan": "STARTER",
"linkAnalytics": 5,
"kind": "country"
}
headers = {
"Authorization": "Bearer YOUR_JWT_TOKEN_HERE",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.status_code)
print(response.json())
{
"message": "Analytics fetched successfully",
"success": true,
"resultData": {
"country": [
{
"country": "United States",
"_count": {
"_all": 150,
"country": 150
}
},
{
"country": "India",
"_count": {
"_all": 85,
"country": 85
}
}
]
}
}
{
"message": "Unauthorized!"
}
{
"message": "Quota not found.!"
}
{
"message": "Internal server error."
}