Make a REST API To Track Products
The full article was originally published by Yehia Tarek on Medium. Read the full article here.
In this article, I make a simple REST API for tracking products using IOTA. This Tracking API will be used by products owner to record their products and all data they need about it(location,owner,modifications,time) then the API will push data to tangle then the API will response with the root address to track all products and array of addresses for each product. This array of addresses should be printed as QR code on each product for QR-code reader to update/read data. For the tangle part I used MAM restricted for communication and generate rout and addresses using it. You can found what I do in details here.
The sequence Diagram of the REST API:
API endpoints,Calls,controller and response
Creating Products Post Call
The client need to send all his products information like id,date,details…etc on JSON array: