Documentation

    Amazon Web Services

    Microsoft Azure

    RapidAPI

    APILayer

Last Update: 2024-09-11

QR Code Generator API


Table of Content


Subscribe on Azure Marketplace
Code sample
API endpoint: /create-static
API endpoint: /create-dynamic
API endpoint: /update
API endpoint: /track
API endpoint: /usage
Troubleshooting

Subscribe on Azure Marketplace


Visit our listings page on the Azure Marketplace and click on 'Get It Now'.

In the Azure portal click on 'Subscribe'.

Select a resource group, give the subscription an internal name, and click on 'Review + subscribe'.

Click on 'Subscribe' to finalize your subscription.

Begin creating your account on our platform by clicking on 'Configure account now'.

You will be directed to the registration page. Here, fill in your account details in the provided fields. After entering all necessary information, click on 'Subscribe' to proceed.

Upon successful registration, your unique API key will be displayed. It is crucial to store this key in a secure location for future use.

Code Samples


The following code sample demonstrates how to create a dynamic QR code that points to this documentation page with our logo. The destination URL can be changed without altering the actual QR code image. Additionally, you can track how many times the QR code has been scanned.

. Replace <Ocp-Apim-Subscription-Key> with the actual API Key you received during the sign-up process.

var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://api-azr.silverlining.cloud/qrcode/create-dynamic");
request.Headers.Add("Ocp-Apim-Subscription-Key", "<Ocp-Apim-Subscription-Key>");
var content = new StringContent("{\n    \"content\": \"https://www.silverlining.cloud/docs/azure/qrcode-api\",\n    \"background_color\": \"#4D4D4E\",\n    \"fill_color\": \"#FFFFFF\",\n    \"image_url\": \"https://s3.amazonaws.com/cdn.silverlining.cloud/Square_Dark-CLOUD3-white-background.png\"\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Generate QR Code Endpoint Playground

This API Playground for our QR Code API allows you to generate custom QR codes in real-time. Simply input the content you'd like encoded, along with any optional parameters such as size or color, and receive a QR code directly from the API. Whether you're integrating QR code generation into your application or just experimenting with different configurations, the playground offers a user-friendly interface for instant results.

"To see the result, please send a request to the API."
API endpoint: /create-static


URL endpoint: https://api-azr.silverlining.cloud/qrcode/create-static


Method: POST


"header": {
  "Ocp-Apim-Subscription-Key": STRING,
  "Content-Type": "application/json"
}


"body": {
  "content": STRING,
  "background_color": STRING,
  "fill_color": STRING,
  "image_url": STRING,
  "error_correction": STRING,
  "border": NUMBER,
  "box_size": NUMBER,
  "return_as_file": BOOLEAN
}



Required

"content": The content to be represented in the QR code.


Optional

"background_color": The background color of the QR code in RGB hex format, preceded by a # (e.g., #4D4D4E). Default is white.
"fill_color": The color of the QR code tiles in RGB hex format, preceded by a # (e.g., #EDEDED). Default is black.
"image_url": A link to a publicly available image that will be placed at the center of the QR code.
"error_correction": Defines the error correction capability of the QR code, ensuring it remains readable even if slightly damaged or obscured. Acceptable values are "Low" (7% of codewords can be restored), "Medium" (15% of codewords can be restored), "Quartile" (25% of codewords can be restored), and "High" (30% of codewords can be restored). Higher error correction levels produce denser QR codes. The default value is "Low".
"border": Specifies the width of the QR code's border filled with the background_colour. Default value is 4.
"box_size": Determines the size of each individual box within the QR code grid, adjusting the overall QR code scale. Default value is 10.
"return_as_file": This parameter controls the format in which the QR Code is delivered. When set to `true`, the API will return the QR Code as a downloadable image file, providing immediate access to the QR Code in a ready-to-use format. In contrast, if set to `false` (or not specified), the API will return a URL pointing to the image of the QR Code, requiring an additional step to access the image file.



Response:

"body": {
  "qrcode_url": STRING,
  "metadata": {
    "content": STRING,
    "background_color": STRING,
    "fill_color": STRING,
    "logo_url": STRING,
    "error_correction": STRING,
    "border": NUMBER,
    "box_size": NUMBER,
    "return_as_file": BOOLEAN
  }
}   


"qrcode_url": The link to the created QR code, available for download.
"content": The content represented on the QR code.
"background_color":The background color used for the QR code.
"fill_color": The tile color used for the QR code.
"logo_url": The link to the used image. Returns None if not present.
"error_correction": The error correction method used.
"border": Width of the border in pixels.
"box_size": Size of each individual box in the grid in pixels.

API endpoint: /create-dynamic


URL endpoint: https://api-azr.silverlining.cloud/qrcode/create-dynamic


Method: POST


"header": {
  "Ocp-Apim-Subscription-Key": STRING,
  "Content-Type": "application/json"
}


"body": {
  "content": STRING,
  "background_color": STRING,
  "fill_color": STRING,
  "image_url": STRING,
  "error_correction": STRING,
  "border": NUMBER,
  "box_size": NUMBER,
  "return_as_file": BOOLEAN
}


Required

"content": The destination URL to which the QR code should redirect the user. This must be a valid URL, including the protocol (http:// or https://).


Optional

"background_color": The background color of the QR code in RGB hex format, preceded by a # (e.g., #4D4D4E). Default is white.
"fill_color": The color of the QR code tiles in RGB hex format, preceded by a # (e.g., #EDEDED). Default is black.
"image_url": A link to a publicly available image that will be placed at the center of the QR code.
"error_correction": Defines the error correction capability of the QR code, ensuring it remains readable even if slightly damaged or obscured. Acceptable values are "Low" (7% of codewords can be restored), "Medium" (15% of codewords can be restored), "Quartile" (25% of codewords can be restored), and "High" (30% of codewords can be restored). Higher error correction levels produce denser QR codes. The default value is "Low".
"border": Specifies the width of the QR code's border filled with the background_colour. Default value is 4.
"box_size": Determines the size of each individual box within the QR code grid, adjusting the overall QR code scale. Default value is 10.
"return_as_file": This parameter controls the format in which the QR Code is delivered. When set to `true`, the API will return the QR Code as a downloadable image file, providing immediate access to the QR Code in a ready-to-use format. In contrast, if set to `false` (or not specified), the API will return a URL pointing to the image of the QR Code, requiring an additional step to access the image file.

Response:

"body": {
  "qrcode_url": STRING,
  "metadata": {
    "content": STRING,
    "redirection_url": STRING,
    "key": STRING,
    "background_color": STRING,
    "fill_color": STRING,
    "logo_url": STRING,
    "error_correction": STRING,
    "border": NUMBER,
    "box_size": NUMBER,
    "return_as_file": BOOLEAN
  }
}   


"qrcode_url": The link to the created QR code, available for download.
"content": The destination URL where the QR code redirects.
"redirection_url": The public URL represented on the QR code.
"key": A unique key associated with the QR code, which must be provided to the /track and /update endpoints.
"background_color": The background color used for the QR code.
"fill_color": The tile color used for the QR code.
"logo_url": The link to the used image. Returns None if not present.
"error_correction": The error correction method used.
"border": Width of the border in pixels.
"box_size": Size of each individual box in the grid in pixels.

API endpoint: /update


URL endpoint: https://api-azr.silverlining.cloud/qrcode/update


Method: POST


"header": {
  "Ocp-Apim-Subscription-Key": STRING,
  "Content-Type": "application/json"
}


"body": {
  "new_content": STRING,
  "key": STRING
}


Required

"new_content": The updated destination URL to which the QR code should redirect the user. This must be a valid URL, including the protocol (http:// or https://).
"key": The key of the QR code that needs to be updated.

Response:

"body": {
  "message": "The content of the QR Code has been updated",
  "metadata": {
    "content": STRING,
    "redirection_url": STRING,
    "key": STRING
  }
}   


"content": The destination URL where the QR code redirects.
"redirection_url": The public URL represented on the QR code.
"key": A unique key associated with the QR code, which must be provided to the /track and /update endpoints.

API endpoint: /track


URL endpoint: https://api-azr.silverlining.cloud/qrcode/track


Method: POST


"header": {
  "Ocp-Apim-Subscription-Key": STRING,
  "Content-Type": "application/json"
}


"body": {
  "key": STRING
}


Required

"key": The key of the QR code.

Response:

"body": {
  "totalHits": NUMBER,
  "metadata": {
    "content": STRING,
    "redirection_url": STRING,
    "key": STRING
  },
  "hits": [{
    "date": DATE,
    "time": TIME,
    "ip": STRING,
    "method": STRING,
    "resource": STRING,
    "referrer": STRING,
    "user": {
      "platform": {
        "name": STRING,
        "version": STRING,
      },
      "os": {
        "name": STRING,
      },
      "bot": BOOLEAN,
      "flavour": {
        "name": STRING,
        "version": STRING,
      },
      "browser": {
        "name": STRING,
        "version": STRING
      }
    },
    "rawUserAgent": STRING,
    "timeTaken": FLOAT
  } ... ],
}   


"totalHits": The number of successfully registered scans.
"content": The destination URL where the QR code redirects.
"redirection_url": The public URL represented on the QR code.
"key": A unique key associated with the QR code, which must be provided to the /track and /update endpoints.
"hits: A list of actual clicks, consisting of the date and time the URL was clicked, the IP address of the click, the referring URL, and detailed information about the user's device.

API endpoint: Usage

URL endpoint: https://api-azr.silverlining.cloud/qrcode/usage


Method: POST


"header": {
  "Ocp-Apim-Subscription-Key": STRING,
  "Content-Type": "application/json"
}

Required 
You must include the API key in the x-api-key header. The body parameters can be left empty.

Response:


"body": {
  "reportUrl": STRING,
  "downloadLink": STRING,
  "description": STRING
}

"reportUrl": A URL linking to a web-based report that displays all requests made to the API. Note that this report is only accessible if the total number of requests is below 100,000.

"downloadLink": A URL to download a .CSV file containing all requests made to our API using the specified API key.

"description": You can access usage statistics either by visiting the website using the 'reportUrl' or by downloading the usage data as a .csv file using the 'downloadLink'. Please note that, depending on the number of requests you have previously sent to our API, these links may become available up to 10 minutes after the request is made.

Troubleshooting

"message": "Invalid Input: The request contains incorrectly formatted parameters"

This error message means that the body parameters you have passed are malformed. Please follow the instructions given in the endpoint descriptions. Common issues include forgetting to add a comma (',') after every parameter line or missing a parenthesis somewhere.

Receiving 503 "The service is unavailable."

You may occasionally encounter the error message: "503 - The service is unavailable." This issue is temporary and typically resolves on its own. It is a problem originating from Microsoft Azure APIM platform and not from our service. Unfortunately, there is nothing we can do on our end to prevent it. We apologize for any inconvenience this may cause.