Jump to content
  • 4

Guide: How to import rest methods to Postman easily?


mustafaboleken
 Share

Question

Hi Guys,

There is a simple way of importing all of the rest methods from Swagger to Postman

Here is a step-by-step guide.

  • Go to https://antmedia.io/rest/ and select the Ant Media Server version you are using on the top right-hand corner.883668247_ScreenShot2022-08-22at17_51_52.thumb.png.260f29e4a7088a67a838f954f86a24e4.png
  • Copy the URL of the swagger.json file.894674005_ScreenShot2022-08-22at17_55_38.thumb.png.adce4e35812c7882ac50857fa531056d.png
  • Open Postman and click the import button.214145232_ScreenShot2022-08-22at17_52_53.thumb.png.2a754dec2b6909e10c14c2c52422c875.png
  • Go to the link section and paste the URL of the swagger.json file copied before.140049966_ScreenShot2022-08-22at17_53_10.thumb.png.d345b019155876051da7f6fb85b15a85.png
  • Click on the Ant Media Server REST API Reference collection and go to the Variables section.1540783093_ScreenShot2022-08-22at17_53_25.thumb.png.c18e1c20c7fc1ad9cd3950d74e89a91f.png
  • Change baseUrl with your domain name.
  • Postman is ready to use ūüôā¬†

 

Note: Current value should be like  https://domain:5443/Application_name/rest

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

I want to run rest API in postman and I want to start broadcast in web browser... How can I start broadcast API from Ant media Server? I have rest API of post with endpoint broadcast/{broadcastid}/start... But it gives error in authorize.. I am using free account and which resources I need to start existing broadcast... Kindly help...

Link to comment
Share on other sites

  • 0

Hi @Developer
Let me try to explain.

Start broadcast API is used to start the stream source broadcast type like RTSP, IP camera or Playlist. If you have created any stream source then using below postman sample, you can start the stream on the server.

curl --location --request POST 'https://domain:5443/App-name/rest/v2/broadcasts/streamId/start' \
--header 'Accept: application/json' 

You need to replace your domain name, application name & stream Id.

Now to call Rest API, please make sure that your IP is whitelisted in the Rest API filter. If you do not have any static IP, you can allow all IPs with 0.0.0.0/0 CIDR block. For more reference about IP filter for Rest API, please check:
https://resources.antmedia.io/docs/securing-the-rest-api?highlight=rest#ip-filter-for-the-rest-api

If you want to start publishing the live stream from browser using Rest API, it is not doable. You need to publish the stream manually from browser. Please check https://resources.antmedia.io/docs/webrtc-publishing

In community edition, only WebRTC publish is available but WebRTC playback is available in Enterprise edition.

I hope it is clear. Please let us know if you have any further questions.

Link to comment
Share on other sites

 Share

×
×
  • Create New...