The following articles provide Postman collections to help you easily perform REST tasks:
- Best practice for recording troubleshooting information in AM (All versions)
- How do I create and update an Agent in AM (All versions) using the REST API?
- How do I create a policy in AM (All versions) using the REST API?
- How do I validate session tokens and obtain session details using the REST API in AM (All versions)?
You can download the collection from the relevant article and use it as described in this article.
First you need to install Postman and then import the required collections.
- Install Postman.
- Select the Manage Environments option from the Settings cog (No environment drop-down in the top right-hand corner of Postman if you do not have any environments configured). You can then add one or more environments or import this example one to get you started: ForgeRockRecordingExampleEnv.postman_environment. You should avoid including specific environment properties to make it easier to switch between environments without modifying your request. If you have multiple AM environments, it is recommended that you create a Postman environment for each one. You can do this by importing the example environment multiple times and then adjusting the values needed. The following examples show four AM environments, where only the port number differs:
- Import a collection by clicking the Import button in the top-left hand corner of Postman. You should now have a new collection on the left-hand side of Postman, like this:
By importing a Postman collection and having the correct environment configured, you should be able to use the example requests immediately. If you want to modify any of the requests, it is recommended that you duplicate the request prior to making changes in order to keep these examples intact for future reference.
All Postman collections included in articles have a series of example requests that include details to get you started and can be modified as needed.
The first request is always to Authenticate. Before running the authenticate request, you should edit the Headers to provide your credentials, for example:
Some requests will require you to update other parts of the REST request such as the Body or a URL parameter. The article providing the Postman collection will indicate what you should update:
- Body: If you need to update the Body, you should provide the same details you would provide in a curl --data option, for example:
- URL parameter: If you need to update a URL parameter (for example, to provide a realm name or agent name), you will see a colon (:) in the URL. Click the Params button to show the available URL parameters and update as needed, for example: