Printer API Usage Guide

<aside> 💡 This guide provides an overview of our Printer API, which is structured with three key endpoints. The initial endpoint is for authentication, ensuring secure access to the other functionalities of the API. The second endpoint handles the generation & acquisition of unique serial codes for a GTIN. Lastly, the third endpoint acknowledges the successful printing of these serial codes, thus rounding off the services our API offers. Each of these endpoints plays a crucial role in the effective utilisation of our API.

</aside>

MarkDown Document

Insomnia collection

<aside> 📎 Download the auxiliary insomnia collection below, it'll provide you with all required endpoints for an easy integration.

printer-endpoints.json

</aside>


Technical requirements

API format: each endpoint is published as a REST-style API call with a JSON payload, accessible over the internet via HTTPS.

Data formats: all data payloads will be in JSON format.

Interface availability: interfaces will ordinarily be available 24/7, except for pre-scheduled downtime.

Environments

Polytag has 2 different API endpoints you can use:

apis.polyt.ag: The staging environment, the endpoint you should use when testing and developing new features.

api.polyt.ag: The production environment, the one you will use after your feature development is done and you’re ready for your customers to use it!

These endpoints are in different environments, so you will have different credentials for each of them. Our examples will use the staging environment endpoint.

Authentication

The authentication endpoint is used to authenticate with the API and obtain three tokens. One of these is the id_token, which is valid for 24 hours and is used to authenticate with the other endpoints.

This endpoint uses the Basic Authentication protocol.