API Try It!
The TRY IT! feature allows you to test your API directly in your browser. It works both on a published doc portal or directly inside the editor.
The Try It! feature uses the fetch API, so in order for it to work, your API imports need to have the following:
- an absolute path URL to your API (not just a path)
- add in your .yml file an URL as follows
- servers:
- url example: https://petstore3.swagger.io/api/v3 (your actual URL)
- authorization methods will be read from your api file and included in each API page
- CORS disabled or enabled for the documentation domain, so the users can actually test your API
Import your API files (direct import or github sync)
[Optional] Define "default" values in your OpenAPI file. This way, when you import your API all "default" values will be added to the code sample, and you can test your API immediately without the need to manually add values to params.
Configure the API method with the test params
After you update the parameters, the code sample on the right(or below, depending on how you set your view) will also update with the test params you added, providing you the code snippet of the request in several languages
Hit the Try it! button and check out the response area, below the sample code