This endpoint is for creating a custom domain
curl -X GET \
'https://divsly-backend.vercel.app/api/v1/custom-domain' \
-H 'Authorization: Bearer YOUR_JWT_TOKEN_HERE'
fetch('https://divsly-backend.vercel.app/api/v1/custom-domain', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE'
}
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
const getCustomDomain = () => {
return new Promise((resolve, reject) => {
fetch('https://divsly-backend.vercel.app/api/v1/custom-domain', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE'
}
})
.then(response => response.json())
.then(data => resolve(data))
.catch(error => reject(error));
});
};
$ch = curl_init('https://divsly-backend.vercel.app/api/v1/custom-domain');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer YOUR_JWT_TOKEN_HERE'
));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$result = json_decode($response, true);
print_r($result);
import requests
url = 'https://divsly-backend.vercel.app/api/v1/custom-domain'
headers = {
'Authorization': 'Bearer YOUR_JWT_TOKEN_HERE'
}
try:
response = requests.get(
url,
headers=headers
)
response.raise_for_status()
print(response.json())
except requests.exceptions.RequestException as e:
print(f"Error: {e}")
{
"status": 200,
"message": "Custom Domains fetched Successfully.",
"data": [
{
"id": 36,
"userId": 89,
"domain": "https://testdomain.com",
"spare": "Yes",
"subDomain": null,
"domainUrl": "https://testdomain.com",
"status": "Pending",
"createdAt": "2025-04-02T04:03:59.254Z",
"updatedAt": "2025-04-02T04:03:59.254Z"
}
]
}
{
"error": true,
"message": "Unauthorized access",
"data": null
}
{
"success": false,
"error": “Error fetching Custom domain”
}