Page 1 of 1

REST API through POSTMAN

Posted: Tue Jul 06, 2021 5:28 pm
by netboyzin
Hello
Is there any Mikrotik documentation available for REST API integration through POSTMAN ?

Abhishek

Re: REST API through POSTMAN

Posted: Sun Feb 27, 2022 9:19 pm
by skocdopolet
I am too interested. Does anybody know about REST API through POSTMAN?

Re: REST API through POSTMAN

Posted: Mon Feb 28, 2022 7:35 pm
by Amm0
Postman would be way easier if there was a OpenAPI or swagger schema... Postman can load those which help a ton, since postman can use that to help build collections/tests/etc. There isn't in forum or docs: viewtopic.php?p=859379&hilit=openapi#p859379

Otherwise, you can use postman to build up the requests similar to `curl` and same store/run them from a postman collection manually.

Not sure what you're planing to use postman for, but IMO you should understand variables so you can do stuff like this: "https://{{routerip}}/rest/{{cmd}}" to automate things more if that's your goal with postman.

But the basic steps are hit "New", create a "New HTTP Request", then in the request:
  • set method, default is "GET", but follow Mikrotik's docs if you need PUT or POST on what to select
  • set URL, in basically, the same as the curl examples, e.g. "https://192.168.88.1/rest/ip/address"
  • under "Authentication", set type to be "Basic Auth". *postman UI has more help on how to store this securely...
  • add "Content-Type" as "application/json" under the "Headers" tab of the request part. *without any ";charset=" part!
  • for operations like PUT/PATCH/DELETE methods, use "Body" tab, select "Raw", then use needed the JSON, per Mikrotik's REST docs. *select "JSON" as type, will validate/"beautify" the text if needed.
  • hit "Send" to set, the results are show in the various tabs at the lower half
  • if works as desired, you can use the "Save" button to save it to a collection.
  • and you can run/exit the request in the future from the "Collections" on left.

Beyond that you should look at the Postman docs: https://learning.postman.com/docs/getti ... roduction/

Re: REST API through POSTMAN

Posted: Mon Sep 11, 2023 7:55 pm
by Amm0
I created a schema that works with Postman, so the endpoints are pre-populated in a Postman collection. See here:
viewtopic.php?t=199476