Labelixa API'sini cURL, Python, Node.js ve PHP ile kullanma örnekleri: ZPL render ve barkod üretimi.
import requests
r = requests.post("https://api.labelixa.com/v1/printers/8dpmm/labels/4x6/0",
data="^XA^CF0,60^FO50,50^FDMerhaba^FS^XZ")
open("etiket.png", "wb").write(r.content)
print(r.headers.get("X-Warnings"))const res = await fetch("https://api.labelixa.com/v1/printers/8dpmm/labels/4x6/0", {
method: "POST", body: "^XA^CF0,60^FO50,50^FDMerhaba^FS^XZ"
});
const buf = Buffer.from(await res.arrayBuffer());
require("fs").writeFileSync("etiket.png", buf);<?php
$ch = curl_init("https://api.labelixa.com/v1/printers/8dpmm/labels/4x6/0");
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, "^XA^CF0,60^FO50,50^FDMerhaba^FS^XZ");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
file_put_contents("etiket.png", curl_exec($ch));curl "https://api.labelixa.com/v1/barcodes?type=ean13&data=869012345678" > urun.pngimport requests
r = requests.get("https://api.labelixa.com/v1/barcodes",
params={"type": "ean13", "data": "869012345678"})
open("urun.png", "wb").write(r.content)curl -X POST "https://api.labelixa.com/v1/printers/8dpmm/labels/4x2/" \
--data-binary @etiketler.zpl -H "Accept: application/pdf" \
-H "X-Page-Size: A4" -H "X-Page-Layout: 2x3" > etiketler.pdf