Get a QR Code

GET /api/v1/qr-code

Common errors include:

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

The createQrCodeHandler creates a qr code for the input body and returns the reponse to users

Request

Method : GET
Content-Type : Application/json

URL Parameters Schema

This endpoint does not require a request body. It takes the user information from the token that is being used
LANGUAGE
REQUEST
 # cURL
    curl -X GET 'https://divsly-backend.vercel.app/api/v1/qr-code' \
    -H 'Authorization: Bearer YOUR_ACCESS_TOKEN'

API REQUEST
 const getQrCodes = () => {
  return new Promise((resolve, reject) => {
	fetch('https://divsly-backend.vercel.app/api/v1/qr-code', {
  	method: 'GET',
  	headers: {
    	'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
    	'Content-Type': 'application/json'
  	}
	})
  	.then(response => response.json())
  	.then(data => resolve(data))
  	.catch(error => reject(error));
  });
    };

getQrCodes()
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

API REQUEST
 const axios = require('axios');

const getQrCodes = () => {
  return new Promise((resolve, reject) => {
	axios({
  	method: 'get',
  	url: 'https://divsly-backend.vercel.app/api/v1/qr-code',
  	headers: {
    	'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
  	}
	})
  	.then(response => resolve(response.data))
  	.catch(error => reject(error.response?.data || error));
  });
};


getQrCodes()
  .then(data => console.log(data))
  .catch(error => console.error('Error:', error));

API REQUEST
 function getQrCodes() {
	$url = "https://divsly-backend.vercel.app/api/v1/qr-code";
    
	$curl = curl_init();
    
	curl_setopt_array($curl, [
    	CURLOPT_URL => $url,
    	CURLOPT_RETURNTRANSFER => true,
    	CURLOPT_SSL_VERIFYPEER => false,  // Disable SSL peer verification
    	CURLOPT_SSL_VERIFYHOST => false,  // Disable SSL host verification
    	CURLOPT_HTTPHEADER => [
        	"Authorization: Bearer YOUR_ACCESS_TOKEN",
        	"Content-Type: application/json"
    	]
	]);
    
	$response = curl_exec($curl);
	$err = curl_error($curl);
    
	curl_close($curl);
    
	if ($err) {
    	return "Error: " . $err;
	} else {
    	return json_decode($response, true);
	}
}

API REQUEST
# Python using requests
import requests

def get_qr_codes():
	url = "https://divsly-backend.vercel.app/api/v1/qr-codes"
	headers = {
    	"Authorization": "Bearer YOUR_ACCESS_TOKEN"
	}
    
	try:
    	response = requests.get(url, headers=headers)
    	return response.json()
	except requests.exceptions.RequestException as e:
    	print(f"Error: {e}")
    	return None

RESPONSE
  {
	"message": "QR codes list retrieved successfully",
	"success": true,
	"resultData": [
    	{
        	"id": 1167,
        	"type": "qr",
        	"type2": null,
        	"userId": 92,
        	"clicks": 0,
        	"lbClicks": 0,
        	"scans": 0,
        	"destinationUrl": "https://divsly.com",
        	"faviconUrl": "assets/img/logo/favicon.png",
        	"title": "Preview",
        	"titleLabel": "preview",
        	"btnLabel": null,
        	"brandedDomain": "kut.lt",
        	"slashTag": "dye6y",
        	"edit": 0,
        	"utm_id": null,
        	"utm_content": null,
        	"utm_term": null,
        	"utm_campaign": null,
        	"utm_medium": null,
        	"utm_source": null,
        	"preset": "#000000",
        	"bgColor": "#ffffff",
        	"color": "#000000",
        	"pattern": "classy",
        	"corner": "square",
        	"logo": "886d912a169c986ca5f98c3450da9edaf3cdf137.png",
        	"qr": "//api.qrcode-monkey.com/tmp/807f36b526d53242cbdb35e73b0f363f.png",
        	"qrLogoId": "886d912a169c986ca5f98c3450da9edaf3cdf137.png",
        	"tags": "",
        	"linkInBioId": null,
        	"uniqueTagId": 1228,
        	"isActive": true,
        	"isStarred": false,
        	"expirationDate": "2025-06-25T06:21:29.854Z",
        	"createdAt": "2025-03-27T06:21:38.331Z",
        	"updatedAt": "2025-03-27T06:21:38.331Z",
        	"fieldData": "{\"destinationUrl\":\"https://divsly.com\",\"title\":\"Preview\",\"metaDescription\":\"\",\"brandedDomain\":\"kut.lt\",\"contentWelcomeImage\":\"\",\"contentWelcomeTime\":2.5,\"password\":\"\",\"passwordProtectionEnabled\":false}",
        	"frame": "",
        	"isadminblocked": false,
        	"isEdit": false,
        	"passwordProtectionEnabled": false,
        	"primary": "",
        	"qrType": "website",
        	"secondary": "",
        	"text": "Scan Me",
        	"textColor": ""
    	}
	]
}
        
  {
    "message": "Unauthorized!"
}

  {
  "success": false,
  "error": “Error fetching QR codes”
}