curl -X POST "https://api.dashlink.ai/api/v1/qrcode/create_qr_code" \
-H "X-API-Key: $DASHLINK_API_KEY" \
-F "destination_url=https://example.com/menu" \
-F 'title=Table menu'
const body = new FormData();
body.append("destination_url", "https://example.com/menu");
body.append("title", "Table menu");
const response = await fetch("https://api.dashlink.ai/api/v1/qrcode/create_qr_code", {
method: "POST",
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
body,
});
const payload = await response.json();
import os
import requests
response = requests.post(
'https://api.dashlink.ai/api/v1/qrcode/create_qr_code',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
data={
'destination_url': 'https://example.com/menu',
'title': 'Table menu',
},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
"net/url"
"strings"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/qrcode/create_qr_code"
form0 := url.Values{
"destination_url": {"https://example.com/menu"},
"title": {"Table menu"},
}
req0, err0 := http.NewRequest("POST", endpoint0, strings.NewReader(form0.Encode()))
if err0 != nil {
panic(err0)
}
req0.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/qrcode/create_qr_code")
request0 = Net::HTTP::Post.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
request0.set_form_data("destination_url" => "https://example.com/menu", "title" => "Table menu")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/qrcode/create_qr_code');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
curl_setopt($ch0, CURLOPT_POSTFIELDS, http_build_query(['destination_url' => 'https://example.com/menu', 'title' => 'Table menu']));
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
This endpoint takes
multipart/form-data, because it can carry a centre logo image.From an existing link
Passshortlink instead of destination_url to attach a QR code to a link you already have:
-F "shortlink=SHORT-0001"
Alongside a new link
create_shortlink can generate one in the same call:
curl -X POST "https://api.dashlink.ai/api/v1/shortlinks/create_shortlink" \
-H "X-API-Key: $DASHLINK_API_KEY" \
-F "destination_url=https://example.com/menu" \
-F "qr_code_enabled=true"
const body = new FormData();
body.append("destination_url", "https://example.com/menu");
body.append("qr_code_enabled", "true");
const response = await fetch("https://api.dashlink.ai/api/v1/shortlinks/create_shortlink", {
method: "POST",
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
body,
});
const payload = await response.json();
import os
import requests
response = requests.post(
'https://api.dashlink.ai/api/v1/shortlinks/create_shortlink',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
data={
'destination_url': 'https://example.com/menu',
'qr_code_enabled': 'true',
},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
"net/url"
"strings"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/shortlinks/create_shortlink"
form0 := url.Values{
"destination_url": {"https://example.com/menu"},
"qr_code_enabled": {"true"},
}
req0, err0 := http.NewRequest("POST", endpoint0, strings.NewReader(form0.Encode()))
if err0 != nil {
panic(err0)
}
req0.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/shortlinks/create_shortlink")
request0 = Net::HTTP::Post.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
request0.set_form_data("destination_url" => "https://example.com/menu", "qr_code_enabled" => "true")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/shortlinks/create_shortlink');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
curl_setopt($ch0, CURLOPT_POSTFIELDS, http_build_query(['destination_url' => 'https://example.com/menu', 'qr_code_enabled' => 'true']));
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
Getting the image
The create response includes image URLs. To fetch a specific format later:curl -X GET "https://api.dashlink.ai/api/v1/qrcode/download_qr_code_image?name=QR-0001&format=svg" \
-H "X-API-Key: $DASHLINK_API_KEY"
const response = await fetch("https://api.dashlink.ai/api/v1/qrcode/download_qr_code_image?name=QR-0001&format=svg", {
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
});
const payload = await response.json();
import os
import requests
response = requests.get(
'https://api.dashlink.ai/api/v1/qrcode/download_qr_code_image?name=QR-0001&format=svg',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/qrcode/download_qr_code_image?name=QR-0001&format=svg"
req0, err0 := http.NewRequest("GET", endpoint0, nil)
if err0 != nil {
panic(err0)
}
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/qrcode/download_qr_code_image?name=QR-0001&format=svg")
request0 = Net::HTTP::Get.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/qrcode/download_qr_code_image?name=QR-0001&format=svg');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
format is png, jpeg or svg. See Downloading.
Updating
curl -X POST "https://api.dashlink.ai/api/v1/qrcode/edit_qr_code" \
-H "X-API-Key: $DASHLINK_API_KEY" \
-F "name=QR-0001" \
-F "pattern_color=#1A1A1A"
const body = new FormData();
body.append("name", "QR-0001");
body.append("pattern_color", "#1A1A1A");
const response = await fetch("https://api.dashlink.ai/api/v1/qrcode/edit_qr_code", {
method: "POST",
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
body,
});
const payload = await response.json();
import os
import requests
response = requests.post(
'https://api.dashlink.ai/api/v1/qrcode/edit_qr_code',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
data={
'name': 'QR-0001',
'pattern_color': '#1A1A1A',
},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
"net/url"
"strings"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/qrcode/edit_qr_code"
form0 := url.Values{
"name": {"QR-0001"},
"pattern_color": {"#1A1A1A"},
}
req0, err0 := http.NewRequest("POST", endpoint0, strings.NewReader(form0.Encode()))
if err0 != nil {
panic(err0)
}
req0.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/qrcode/edit_qr_code")
request0 = Net::HTTP::Post.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
request0.set_form_data("name" => "QR-0001", "pattern_color" => "#1A1A1A")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/qrcode/edit_qr_code');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
curl_setopt($ch0, CURLOPT_POSTFIELDS, http_build_query(['name' => 'QR-0001', 'pattern_color' => '#1A1A1A']));
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
Listing
curl -X GET "https://api.dashlink.ai/api/v1/qrcode/get_qrcodes?per_page=50&sort_by=most_recent&order=desc" \
-H "X-API-Key: $DASHLINK_API_KEY"
const response = await fetch("https://api.dashlink.ai/api/v1/qrcode/get_qrcodes?per_page=50&sort_by=most_recent&order=desc", {
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
});
const payload = await response.json();
import os
import requests
response = requests.get(
'https://api.dashlink.ai/api/v1/qrcode/get_qrcodes?per_page=50&sort_by=most_recent&order=desc',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/qrcode/get_qrcodes?per_page=50&sort_by=most_recent&order=desc"
req0, err0 := http.NewRequest("GET", endpoint0, nil)
if err0 != nil {
panic(err0)
}
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/qrcode/get_qrcodes?per_page=50&sort_by=most_recent&order=desc")
request0 = Net::HTTP::Get.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/qrcode/get_qrcodes?per_page=50&sort_by=most_recent&order=desc');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
tags, enabled, date_from, date_to.
Deleting
Bulk-only:curl -X POST "https://api.dashlink.ai/api/v1/qrcode/bulk_edit" \
-H "X-API-Key: $DASHLINK_API_KEY" \
-d "action=delete" \
-d 'docnames=["QR-0001"]'
const body = new URLSearchParams();
body.append("action", "delete");
body.append("docnames", "[\"QR-0001\"]");
const response = await fetch("https://api.dashlink.ai/api/v1/qrcode/bulk_edit", {
method: "POST",
headers: { "X-API-Key": process.env.DASHLINK_API_KEY },
body,
});
const payload = await response.json();
import os
import requests
response = requests.post(
'https://api.dashlink.ai/api/v1/qrcode/bulk_edit',
headers={'X-API-Key': os.environ["DASHLINK_API_KEY"]},
data={
'action': 'delete',
'docnames': '["QR-0001"]',
},
)
payload = response.json()
package main
import (
"fmt"
"io"
"net/http"
"os"
"net/url"
"strings"
)
func main() {
endpoint0 := "https://api.dashlink.ai/api/v1/qrcode/bulk_edit"
form0 := url.Values{
"action": {"delete"},
"docnames": {"[\"QR-0001\"]"},
}
req0, err0 := http.NewRequest("POST", endpoint0, strings.NewReader(form0.Encode()))
if err0 != nil {
panic(err0)
}
req0.Header.Set("Content-Type", "application/x-www-form-urlencoded")
req0.Header.Set("X-API-Key", os.Getenv("DASHLINK_API_KEY"))
resp0, err0b := http.DefaultClient.Do(req0)
if err0b != nil {
panic(err0b)
}
defer resp0.Body.Close()
body0, _ := io.ReadAll(resp0.Body)
fmt.Println(string(body0))
}
require "net/http"
require "json"
require "uri"
uri0 = URI("https://api.dashlink.ai/api/v1/qrcode/bulk_edit")
request0 = Net::HTTP::Post.new(uri0)
request0["X-API-Key"] = ENV.fetch("DASHLINK_API_KEY")
request0.set_form_data("action" => "delete", "docnames" => "[\"QR-0001\"]")
response0 = Net::HTTP.start(uri0.hostname, uri0.port, use_ssl: true) do |http|
http.request(request0)
end
payload0 = JSON.parse(response0.body)
<?php
$ch0 = curl_init('https://api.dashlink.ai/api/v1/qrcode/bulk_edit');
curl_setopt($ch0, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch0, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch0, CURLOPT_HTTPHEADER, [
"X-API-Key: " . getenv("DASHLINK_API_KEY"),
]);
curl_setopt($ch0, CURLOPT_POSTFIELDS, http_build_query(['action' => 'delete', 'docnames' => '["QR-0001"]']));
$payload0 = json_decode(curl_exec($ch0), true);
curl_close($ch0);
Deleting a QR code also deletes the Shortlink behind it. Every printed copy stops working, permanently. Use
action=disable if you might want it back.