Install and configure a REST client to trigger REST API and generate code snippets
Postman
- Powerful HTTP client for testing web services.
- Makes it easy to test, develop and document APIs by allowing users to quickly put together both simple and complex HTTP requests.
- Google Chrome app for interacting with HTTP APIs. It presents you with a friendly GUI for constructing requests and reading responses.
- Offers an add-on package called Jetpacks, which includes some automation tools and, most crucially, a Javascript testing library.
- Download Postman here.
Disabling SSL Certificate Verification
- Select File -> Settings
- Set SSL Certificate Verification to OFF
Configuring a REST API Call
- Select a method (GET, POST, PUT or DELETE).
- Copy and paste the Request URL from the REST API explorer.
- Select the Authorization tab.
- Select Type as Basic Auth from the drop-down menu.
- Enter PE (Prism Element) Username and Password and click Update Request.
Configuring a REST API Call (Copy & Paste)
- Select Body tab.
- Select raw and select Text as JSON (application/json).
- Copy and paste the Body’s content from the REST API explorer.
- Click Send to invoke the REST API call.
Creating a Script using curl
- Create a Bash shell script and have the cURL command pasted on it.
Converting REST API Call to Python
- Create a Python snippet using this process:
- Select Python Request.
- Click Copy to Clipboard.
- Paste the clipboard contents to a Python script.
- Execute the Python script using Python <script filename>.