Get a Short Link

GET /api/v1/short-link

Common errors include:

  • "Bad Request" if body parameters are not passed
  • "DNS_CONFIGURATION_ERROR" if custom domain DNS is misconfigured.

The getShortLinks gets all the short links and returns the response to users

Request

Method : GET
Content-Type : Application/json

Request Body Schema

user_id string Required
ID of the user making the request.
parentUser string
Default: null
Optional parent user ID that overrides user_id if present.
type enum Required
Type of links to fetch. Must be one of: SHORT_LINK, QR, BIO_LINK, QR_N, BIO_PAGE.

Response Body Schema

message string Required
Success/error message.
success string
Default: null
Indicates if operation was successful.
resultData enum Required
Array of link objects matching the query criteria.
error string
Default: null
Error message if success is false.
LANGUAGE
REQUEST
 curl --location “https://divsly-dev-backend.vercel.app/api/v1/short-link”
                                         –header ‘Authorization: Bearer YOUR_ACCESS_TOKEN’

API REQUEST
 const fetchShortLinks = () => {
  return new Promise((resolve, reject) => {
    fetch("https://divsly-backend.vercel.app/api/v1/short-link", {
      method: "GET",
      headers: {
        Authorization: "Bearer YOUR_ACCESS_TOKEN",
      }
    })
      .then(response => response.json())
      .then(data => resolve(data))
      .catch(error => reject(error));
  });
};

fetchShortLinks()
  .then(data => console.log(data))
  .catch(error => console.error("Error:", error));
                   
API REQUEST
 const axios = require('axios');

const getShortLinks = () => {
  return new Promise((resolve, reject) => {
    const url = "https://divsly-backend.vercel.app/api/v1/short-link";
    const headers = {
      Authorization: "Bearer YOUR_ACCESS_TOKEN"
    };

    axios.get(url, { headers })
      .then(response => resolve(response.data))
      .catch(error => reject(error.response?.data || error.message));
  });
};

getShortLinks()
  .then(data => console.log(data))
  .catch(error => console.error(`Error: ${error}`));

API REQUEST
 $curl = curl_init();

curl_setopt_array($curl, [
    CURLOPT_URL => "https://divsly-backend.vercel.app/api/v1/short-link",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_ENCODING => "",
    CURLOPT_MAXREDIRS => 10,
    CURLOPT_TIMEOUT => 30,
      CURLOPT_SSL_VERIFYPEER => false,  
      CURLOPT_SSL_VERIFYHOST => false,
    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer YOUR_ACCESS_TOKEN"
    ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
    echo "cURL Error #: " . $err;
} else {
    echo $response;
}

API REQUEST
 import requests

def get_short_links():
    url = "https://divsly-backend.vercel.app/api/v1/short-link"
    headers = {
        "Authorization": "Bearer YOUR_ACCESS_TOKEN"
    }

    try:
        response = requests.get(url, headers=headers)
        response.raise_for_status()  # Raises an HTTPError for bad responses
        return response.json()
    except requests.exceptions.RequestException as e:
        print(f"Error: {e}")
        return None
RESPONSE
 {
    "message": "Short Links list fetched successfully",
    "success": true,
    "resultData": [
      {
        "id": 1166,
        "type": "shortlink",
        "type2": null,
        "userId": 92,
        "clicks": 0,
        "lbClicks": 0,
        "scans": 0,
        "destinationUrl": "https://example.com/page2",
        "faviconUrl": "",
        "title": "Example Page 2",
        "titleLabel": "example page 2",
        "btnLabel": null,
        "brandedDomain": "your-domain.com",
        "slashTag": "hs5c9",
        "edit": 0,
        "utm_id": null,
        "utm_content": null,
        "utm_term": null,
        "utm_campaign": null,
        "utm_medium": null,
        "utm_source": null,
        "preset": null,
        "bgColor": null,
        "color": null,
        "pattern": null,
        "corner": null,
        "logo": null,
        "qr": null,
        "qrLogoId": null,
        "tags": "winter,promo",
        "linkInBioId": null,
        "uniqueTagId": 1225,
        "isActive": true,
        "isStarred": false,
        "expirationDate": "2025-06-25T05:53:00.271Z",
        "createdAt": "2025-03-27T05:53:00.273Z",
        "updatedAt": "2025-03-27T05:53:00.273Z",
        "fieldData": null,
        "frame": null,
        "isadminblocked": false,
        "isEdit": false,
        "passwordProtectionEnabled": false,
        "primary": null,
        "qrType": null,
        "secondary": null,
        "text": null,
        "textColor": null
      }
    ]
}
        
 {
    "message": "Unauthorized!"
}

      
 {
  "error": true,
  "data": null
}