Generate QR code (POST)
curl --request POST \
--url https://pref.rio/link/api/qr \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": "https://example.com",
"background_color": "#FFFFFF",
"border_width": 2,
"error_correction": "high",
"foreground_color": "#000000",
"format": "png",
"include_logo": true,
"logo_color": "#FF5733",
"logo_shape": "circle",
"module_shape": "square",
"size": 512,
"transparent_background": false
}
'import requests
url = "https://pref.rio/link/api/qr"
payload = {
"data": "https://example.com",
"background_color": "#FFFFFF",
"border_width": 2,
"error_correction": "high",
"foreground_color": "#000000",
"format": "png",
"include_logo": True,
"logo_color": "#FF5733",
"logo_shape": "circle",
"module_shape": "square",
"size": 512,
"transparent_background": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: 'https://example.com',
background_color: '#FFFFFF',
border_width: 2,
error_correction: 'high',
foreground_color: '#000000',
format: 'png',
include_logo: true,
logo_color: '#FF5733',
logo_shape: 'circle',
module_shape: 'square',
size: 512,
transparent_background: false
})
};
fetch('https://pref.rio/link/api/qr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pref.rio/link/api/qr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => 'https://example.com',
'background_color' => '#FFFFFF',
'border_width' => 2,
'error_correction' => 'high',
'foreground_color' => '#000000',
'format' => 'png',
'include_logo' => true,
'logo_color' => '#FF5733',
'logo_shape' => 'circle',
'module_shape' => 'square',
'size' => 512,
'transparent_background' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pref.rio/link/api/qr"
payload := strings.NewReader("{\n \"data\": \"https://example.com\",\n \"background_color\": \"#FFFFFF\",\n \"border_width\": 2,\n \"error_correction\": \"high\",\n \"foreground_color\": \"#000000\",\n \"format\": \"png\",\n \"include_logo\": true,\n \"logo_color\": \"#FF5733\",\n \"logo_shape\": \"circle\",\n \"module_shape\": \"square\",\n \"size\": 512,\n \"transparent_background\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pref.rio/link/api/qr")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": \"https://example.com\",\n \"background_color\": \"#FFFFFF\",\n \"border_width\": 2,\n \"error_correction\": \"high\",\n \"foreground_color\": \"#000000\",\n \"format\": \"png\",\n \"include_logo\": true,\n \"logo_color\": \"#FF5733\",\n \"logo_shape\": \"circle\",\n \"module_shape\": \"square\",\n \"size\": 512,\n \"transparent_background\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pref.rio/link/api/qr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": \"https://example.com\",\n \"background_color\": \"#FFFFFF\",\n \"border_width\": 2,\n \"error_correction\": \"high\",\n \"foreground_color\": \"#000000\",\n \"format\": \"png\",\n \"include_logo\": true,\n \"logo_color\": \"#FF5733\",\n \"logo_shape\": \"circle\",\n \"module_shape\": \"square\",\n \"size\": 512,\n \"transparent_background\": false\n}"
response = http.request(request)
puts response.read_body"<string>"{}{}qrcode
Generate QR code (POST)
Generate a QR code with full customization options via JSON body
POST
/
qr
Generate QR code (POST)
curl --request POST \
--url https://pref.rio/link/api/qr \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"data": "https://example.com",
"background_color": "#FFFFFF",
"border_width": 2,
"error_correction": "high",
"foreground_color": "#000000",
"format": "png",
"include_logo": true,
"logo_color": "#FF5733",
"logo_shape": "circle",
"module_shape": "square",
"size": 512,
"transparent_background": false
}
'import requests
url = "https://pref.rio/link/api/qr"
payload = {
"data": "https://example.com",
"background_color": "#FFFFFF",
"border_width": 2,
"error_correction": "high",
"foreground_color": "#000000",
"format": "png",
"include_logo": True,
"logo_color": "#FF5733",
"logo_shape": "circle",
"module_shape": "square",
"size": 512,
"transparent_background": False
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
data: 'https://example.com',
background_color: '#FFFFFF',
border_width: 2,
error_correction: 'high',
foreground_color: '#000000',
format: 'png',
include_logo: true,
logo_color: '#FF5733',
logo_shape: 'circle',
module_shape: 'square',
size: 512,
transparent_background: false
})
};
fetch('https://pref.rio/link/api/qr', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pref.rio/link/api/qr",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'data' => 'https://example.com',
'background_color' => '#FFFFFF',
'border_width' => 2,
'error_correction' => 'high',
'foreground_color' => '#000000',
'format' => 'png',
'include_logo' => true,
'logo_color' => '#FF5733',
'logo_shape' => 'circle',
'module_shape' => 'square',
'size' => 512,
'transparent_background' => false
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pref.rio/link/api/qr"
payload := strings.NewReader("{\n \"data\": \"https://example.com\",\n \"background_color\": \"#FFFFFF\",\n \"border_width\": 2,\n \"error_correction\": \"high\",\n \"foreground_color\": \"#000000\",\n \"format\": \"png\",\n \"include_logo\": true,\n \"logo_color\": \"#FF5733\",\n \"logo_shape\": \"circle\",\n \"module_shape\": \"square\",\n \"size\": 512,\n \"transparent_background\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pref.rio/link/api/qr")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"data\": \"https://example.com\",\n \"background_color\": \"#FFFFFF\",\n \"border_width\": 2,\n \"error_correction\": \"high\",\n \"foreground_color\": \"#000000\",\n \"format\": \"png\",\n \"include_logo\": true,\n \"logo_color\": \"#FF5733\",\n \"logo_shape\": \"circle\",\n \"module_shape\": \"square\",\n \"size\": 512,\n \"transparent_background\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pref.rio/link/api/qr")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"data\": \"https://example.com\",\n \"background_color\": \"#FFFFFF\",\n \"border_width\": 2,\n \"error_correction\": \"high\",\n \"foreground_color\": \"#000000\",\n \"format\": \"png\",\n \"include_logo\": true,\n \"logo_color\": \"#FF5733\",\n \"logo_shape\": \"circle\",\n \"module_shape\": \"square\",\n \"size\": 512,\n \"transparent_background\": false\n}"
response = http.request(request)
puts response.read_body"<string>"{}{}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
QR code generation request
Example:
"https://example.com"
Example:
"#FFFFFF"
Example:
2
Example:
"high"
Example:
"#000000"
Example:
"png"
Example:
true
Example:
"#FF5733"
Example:
"circle"
Example:
"square"
Example:
512
Example:
false
Response
QR code image
The response is of type file.
⌘I
