Tasks
Generate QR Code
This task generates and attaches a QR code image to a stub.
Basic usage
Parameters
content required string
The text, URL, or data that will be encoded into the QR code.
Example: "https://www.stubber.com"
settings required object
Configuration options for how the QR code is generated and formatted.
settings.error_correction_level optional string
Sets the error correction capability for the QR code. Valid values:
L— ~7% error recoveryM— ~15% error recovery (default)Q— ~25% error recoveryH— ~30% error recovery
settings.appearance optional object
Defines the visual characteristics of the QR code image.
- width optionalnumber— Width of the generated QR code in pixels. Default:
200. - margin optionalnumber— Margin (quiet zone) in pixels. Default:
2. - color.dark optionalstring— The color of the dark modules in hex format. Default:
#000000. - color.light optionalstring— The background color in hex format. Default:
#FFFFFF.
settings.output optional object
Specifies how and where the generated QR code will be saved.
- format requiredstring— Output format. Supported:
"png", - filename requiredstring— The filename to assign to the saved QR code image. Example:
"stubber_qr.png".
Examples
Example with minimal parameters
Most of the parameters are not required for the QR code generation, for most cases using only the minimal parameters will be sufficient. Here is an example of the task with only the required parameters: