Postman is a tool that can be used to test SignalWire API Requests. Follow the steps below to set up an instance of Postman to test API requests from SignalWire:
First, go to the SignalWire Space and choose the project that will be accessed. Go to the API tab on the left side and copy the Project ID, SignalWire Space, and Auth Token. These will be needed for every request.
On the Postman home page, click the gear in the upper right corner. This will open up environments to allow setting the project ID, space, and Auth token as an environment variable so that they don’t have to be re-entered repeatedly.
- Now click on the drop down menu that says No Environment and choose the one created.
Note: A different environment should be created for each project that uses the same name for the space, project ID, and auth token so that projects can be easily switched between without having to change saved requests.
- Next, make a collection for each project. Using a Collection allows grouping of requests together and performs authentication at the Collection level instead of having to enter authentication each time. Click the orange + button in the left corner that says New Collection . Go to the Authorization tab and choose Basic Auth from the dropdown menu. Enter the Project ID Variable name between two sets of curly braces for the username and AuthToken variable name nested between two curly braces for the password.
- Hover over the collection on the left sidebar and three dots appear. Click the three dots then click Add Request.
- API requests can be entered easily by copying from the documentation, without having to include authentication or worry about formatting or encoding. As a general rule, all GET requests use the Query Params tab and POST, PUT, and PATCH use the body tab. Our Compatibility API will use x-www-form-urlencoded as the type, and Relay REST will use type Raw and select JSON then input the JSON data.
Query Param (GET) Example:
Body (POST) Example
Body (RAW JSON):
Updated about 2 months ago