MarkMagic PI REST APIs
The MarkMagic PI REST APIs menu option takes you to a Swagger UI page that outlines all of the available MMPI REST API endpoints. This page is designed for developers to make it much simpler to visualize and interact with the programming APIs made available in MMPI. Almost any action within MMPI, be it printing a label, importing a format from file, downloading log files, converting graphics, etc can be accomplished through a REST API endpoint.
Click on any of the API names to reveal the request types available for that specific API endpoint. MMPI makes use of standard HTTP request methods GET, POST, PUT and DELETE. For example, if you wanted to write a program that updates the IP address of a printer that was originally configured through Maintain Printers, you would do this in your program via a PUT request via the /printer API.
The Swagger UI outlines all of the parameters and formatting necessary to interact with the APIs. Extra descriptions and implementation notes are also provided where needed. The Swagger UI even allows you to try out your requests by pressing the Try it out! button.
After pressing the Try it out! button in the above example, you will see the properly formatted Request URL, Response Body, Response Code and Response Headers.
The above examples showed using a PUT request on the /printer API to change the IP address of the Zebra_01 printer. Response code of 200 indicates success and you can see in the body that the IP address was updated to 192.168.4.156.
Click on other API names to explore the Swagger UI and see all of the different MMPI APIs available to you.