Define API request

After you create a collection in Postman, you will need to add your API endpoint. To do, follow the steps below:

  • Right click on the collection name and select Add request request.

Variables

  • Add the request endpoint and set if this will be using GET or POST. For example, if you want to search for a user, you can do the following:

    • Method: Post
    • Endpoint: https://[your OpenIAM instance]/webconsole/rest/api/users/search?deepCopy=true
  • On the Headers tab, add a content-type

Key: Content-Type Value: application/json

  • On the Body tab, add the search parameters as shown below
{
"from": 0,
"size": 20,
"lastName": null,
"firstName": null,
"principal": "sysadmin",
"email": "",
"roleIds": [],
"groupIds": [],
"organizationIds": [],
"employeeId": "",
"fromDirectoryLookup": false,
"sortBy": "name",
"orderBy": "ASC"
}

The example above shows how to search by the user principal. Similarly, you can search for all people with the a lastname starting with "s" using the following:

{
"from": 0,
"size": 20,
"lastName": "s",
"firstName": null,
"principal": "",
"email": "",
"roleIds": [],
"groupIds": [],
"organizationIds": [],
"employeeId": "",
"fromDirectoryLookup": false,
"sortBy": "name",
"orderBy": "ASC"
}

Testing your request

With the above steps, you are can now test your reqest. Use the steps below:

  • Go to your collection. From the Authorization tab get an access token by clicking on Get new access token. Save the collection again.
  • Go to your request and click on Send. You will see response to the example below.

Variables