This document describes how to use the Postman tool for Server API testing.
Postman is an API testing tool, which makes it easy to ensure your APIs are reliable and ready to launch.
For your convenience, ZEGO provides the Postman Collection and predefines request parameters for each API. When the Collection is imported, you can start testing the RTC Server APIs after changing the parameter values.
The UI of Postman varies on different platforms. This document uses Postman on macOS as an example.
If the AppID uses the testing environment (for details, see the description of the IsTest
parameter in Accessing Server APIs - Public parameters), you need to change the IsTest
value (the last parameter in the figure above) to true
.
The following 3 APIs are used as examples to describe how to use Postman for API testing.
The Postman Collection provided by ZEGO automatically fills in public parameters with environment variables and pre-scripts. You can see the pre-script in the location shown below and use it as a reference when developing the server API.
This API is used for sending broadcast messages in a room.
You need to log in to a room before making the API call.
You can refer to the Quick start to build your own app and log in to a room.
Parameter values wrapped in double curly braces are environment variables and do not need to be modified.
0
, then modify your request and send it again.This API is used for kicking one or more specified users out of a room, and all the streaming operations of the target user will stop.
You need to log in to a room before making the API call.
You can refer to the Quick start to build your own app and log in to a room.
UserId[]
is the ID of the target user that you want to kick out. You can kick out of 1-5 users at a time, for more, check the description of this parameter.
0
, then modify your request and send it again.This API is used for starting or updating a stream mixing task.
Before using this interface for the first time, you need to contact ZEGO technical support to activate it.
Body
parameters accordingly. 0
, then modify your request and send it again.