1. Tasks
  2. Generate QR Code

Tasks

Generate QR Code

This task generates and attaches a QR code image to a stub.

Basic usage

loading...

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 recovery
  • M — ~15% error recovery (default)
  • Q — ~25% error recovery
  • H — ~30% error recovery

settings.appearance
optional
object

Defines the visual characteristics of the QR code image.

  • width
    optional
    number
    — Width of the generated QR code in pixels. Default: 200.
  • margin
    optional
    number
    — Margin (quiet zone) in pixels. Default: 2.
  • color.dark
    optional
    string
    — The color of the dark modules in hex format. Default: #000000.
  • color.light
    optional
    string
    — The background color in hex format. Default: #FFFFFF.

settings.output
optional
object

Specifies how and where the generated QR code will be saved.

  • format
    required
    string
    — Output format. Supported: "png",
  • filename
    required
    string
    — 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:

loading...