Documentation
    Amazon Web Services
    Microsoft Azure
    RapidAPI
    APILayer
Last Update: 2024-03-01

QR Code Generator API


Table of Content


Subscribe on AWS Marketplace
Code sample
API endpoint: /static/create
API endpoint: /dynamic/create
API endpoint: /dynamic/update
API endpoint: /dynamic/track
Troubleshooting

Subscribe on AWS Marketplace


Navigate to our product listing on the AWS Marketplace. Select the "View purchase options" button to proceed.

On the following page, click the "Subscribe" button to initiate the subscription process.

After subscribing, you will need to set up your account on our platform. Do this by clicking the "Set up your account" link provided.

You will be directed to the registration page. Here, fill in your account details in the provided fields. Once you have entered all necessary information, click the 'Subscribe' button 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 <YourApiKey> with the actual API Key you received during the sign-up process.

var client = new RestClient("https://qrcode-aws.silverlining.cloud/dynamic/create");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<YourApiKey>");
request.AddHeader("Content-Type", "application/json");
var body = @"{" + "\n" +
@"    ""content"": ""https://www.silverlining.cloud/docs/aws/qrcode""," + "\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" +
@"}";
request.AddParameter("application/json", body,  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
API endpoint: /static/create


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


Method: POST


"header": {
  "x-api-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: /dynamic/create


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


Method: POST


"header": {
  "x-api-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: /dynamic/update


URL endpoint: https://qrcode-aws.silverlining.cloud/dynamic/update


Method: POST


"header": {
  "x-api-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: /dynamic/track


URL endpoint: https://qrcode-aws.silverlining.cloud/dynamic/track


Method: POST


"header": {
  "x-api-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.

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.

"message": "Endpoint request timed out"

You receive this error message when the code execution exceeds the maximum timeout (usually 29 seconds).