This endpoint generates a QR code based on the provided text and size parameters. It returns the URL of the generated QR code image.
Method: GET
Query Parameters
- text (string): The text content to encode into the QR code. This parameter is required.
- size (integer): The size (width and height) of the generated QR code in pixels. This parameter is required and must be a number between 200 and 6000.
Usage
To use this endpoint, make a GET request to the following URL with the required query parameters:
https://node.nodetrigger.com/generate-qrcode?text=YOUR_TEXT&size=YOUR_SIZE
Replace YOUR_TEXT
with the text you want to encode and YOUR_SIZE
with the desired size of the QR code.
Response
- 200 OK: The request was successful, and the response will contain the URL of the generated QR code.
- qr_code_url (string): The URL where the generated QR code image can be accessed.
- 400 Bad Request: The request was invalid. This can occur if the
text
orsize
parameters are missing, or ifsize
is not within the valid range. - error (string): A description of the error.
- 500 Internal Server Error: An error occurred on the server while generating the QR code.
- error (string): A description of the error.
- message (string): The detailed error message.
Examples
Example 1: Basic QR Code Generation
Request:
GET https://node.nodetrigger.com/generate-qrcode?text=HelloWorld&size=300
Response:
{
"qr_code_url": "https://node.nodetrigger.com/uploads/qrcode_48656c6c6f576f726c64_300.png"
}
Example 2: Invalid Size Parameter
Request:
GET https://node.nodetrigger.com/generate-qrcode?text=HelloWorld&size=50
Response:
{
"error": "The size parameter is invalid. It must be a number between 200 and 6000."
}