Original content is here for now.
- Download and install Postman, or use http://postman.com
- Launch Postman and create a new collection that will be used for all LogicMonitor API requests:
- In Postman, click Import and paste https://www.logicmonitor.com/swagger-ui-master/api-v3/dist/swagger.json. This should start the import process.
- Before clicking the import button, click the gear to view import settings.
- Make sure "Always inherit authentication" is checked on.
- Configure Authentication:
- Go to the collection root and select the auth tab.
- Change the auth type to "Bearer Token" and put {{bearer}} as the token.
- Go to the scripts tab and add this to the pre-request script:
pm.request.headers.add({key: 'X-Version', value: '3'}) - Save the collection.
- Create a new environment with the following variables. You just need one for the bearer token. You should set the type to 'secret' for sensitive credentials.
- url – https://<portalname>.logicmonitor.com/santaba/rest
- If you want to work with the LM Ingestion API, duplicate this environment and change the url to 'https://<portalname>.logicmonitor.com/rest' (without "santaba")
- bearer – secret – For the current value, be sure to prepend the token with "bearer " (with space)
And that should do it. You should be able to open any request already defined in the collection you imported and run it.
No comments:
Post a Comment