Generate a QR Code
Creates a QR code image.You must use a PUBLIC KEY for this request. You can create a public key here.
QR codes may need to be embedded as URLs into an image source. So we recommend using a querystring to pass over the parameters for this.
/
https://api-eu1.stannp.com/v1/qrcode/create
Parameters
size | int | Optional. The size in pixels of the QR code. |
data | string | The content you wish the QRcode to contain. |
Request
$ curl https://api-eu1.stannp.com/v1/qrcode/create?size=300&data=hello+world \ -u {API_KEY}:
define("API_KEY", "YOUR API KEY"); $opts = array( 'http' => array( 'method' => 'GET', 'header' => 'Content-type: application/x-www-form-urlencoded' ) ); $context = stream_context_create($opts); $result = file_get_contents("https://api-eu1.stannp.com/v1/qrcode/create?size=300&data=hello+world?api_key=" . API_KEY, false, $context); $response = json_decode($result, true); print_r($response);
import requests response = requests.get('https://api-eu1.stannp.com/v1/qrcode/create?size=300&data=hello+world?api_key={API_KEY}') print(response.text)
var client = new RestClient("https://api-eu1.stannp.com/v1/qrcode/create?size=300&data=hello+world?api_key={API_KEY}"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);Response
Merge PDF files
Merge multiple pdf files into a single file.https://api-eu1.stannp.com/v1/pdf/merge
Parameters
files | mandatory |
An array of files you wish to merge together. Must be a url. eg:
files[]=https://file1.pdf&files[]=https://file2.pdf
|
Request
$ curl https://api-eu1.stannp.com/v1/pdf/merge \ -u {API_KEY}: \ -d "files[0]=http://file1.pdf" \ -d "files[1]=http://file1.pdf"
$curl = curl_init(); curl_setopt_array($curl, array( CURLOPT_URL => 'https://api-eu1.stannp.com/v1/pdf/merge?api_key={API_KEY}', CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'POST', CURLOPT_POSTFIELDS => array( 'files[0]' => "http://file1.pdf", 'files[1]' => "http://file1.pdf" ), )); $response = curl_exec($curl); curl_close($curl); print_r($response);
import requests data = { 'files[0]': 'http://file1.pdf', 'files[1]': 'http://file1.pdf' } response = requests.post('https://api-eu1.stannp.com/v1/pdf/merge?api_key={API_KEY}', data=data) print(response.text)
var client = new RestClient("https://api-eu1.stannp.com/v1/pdf/merge?api_key={API_KEY}"); var request = new RestRequest(Method.POST); request.AddParameter("files[0]", "http://file1.pdf"); request.AddParameter("files[1]", "http://file1.pdf"); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content)Response
{ "success": true, "data": "https://merged-file.pdf" }
Get templates
Get the templates created on your account.https://api-us1.stannp.com/v1/templates/list
Request
$ curl https://api-us1.stannp.com/v1/templates/list \ -u {API_KEY}:
define("API_KEY", "YOUR API KEY"); $opts = array( 'http' => array( 'method' => 'GET', 'header' => 'Content-type: application/x-www-form-urlencoded' ) ); $context = stream_context_create($opts); $result = file_get_contents("https://api-us1.stannp.com/v1/templates/list?api_key=" . API_KEY, false, $context); $response = json_decode($result, true); print_r($response);
import requests response = requests.get('https://api-us1.stannp.com/v1/templates/list?api_key={API_KEY}') print(response.text)
var client = new RestClient("https://api-us1.stannp.com/v1/templates/list?api_key={API_KEY}"); var request = new RestRequest(Method.GET); IRestResponse response = client.Execute(request); Console.WriteLine(response.Content);Response
{ "success": true, "data": [ { "id": "0", "account_id": "0", "template_name": "Template name 1", "image": "", "created": "2023-09-06 12:37:21", "updated": "2023-11-01 09:53:20", "size": "letter", "page_count": "1", "duplex": "1", "back_image": null, "template": "", "is_public": "1", "is_template": "1", "version": "3", "is_hidden": "1", "shared": "0", "user_id": "0", "tags": "", "versions": "3" }, { "id": "0", "account_id": "0", "template_name": "Template name 2", "image": "", "created": "2023-09-06 11:44:37", "updated": "2023-11-01 09:52:50", "size": "A6", "page_count": "1", "duplex": "1", "back_image": null, "template": "", "is_public": "1", "is_template": "1", "version": "3", "is_hidden": "1", "shared": "0", "user_id": "0", "tags": "", "versions": "2" } ] }