How do I understand the underlying REST call being used in web requests in Identity Cloud or AM (All versions)?
The purpose of this article is to provide information on finding out what is included in REST calls being made in ForgeRock Identity Cloud or AM. This technique can be useful to help you formulate REST calls based on an existing web request or to troubleshoot why a REST call is not working as expected.
Overview
You can use the Developer Tools in your browser to
See How do I avoid common issues with REST calls in AM (All versions)? for other troubleshooting tips.
Copying to curl
You can copy a web request to curl as follows:
- Launch the Developer Tools in your browser and select the Network tab.
- Enter the URL that you want to examine web requests for
and let it load fully . - Right-click on the required web request
on the Network tab , select Copy followed by Copy as cURL. - Paste the resulting curl command into a text file or onto the command line as needed.
These instructions apply to Chrome™, Firefox® and Microsoft
Example
Copying the web request for creating a basic authentication tree produces the following curl command:
curl 'https://am.example.com:8443/am/json/realms/root/realm-config/authentication/authenticationtrees/trees/sampleTree' \ -X 'PUT' \ -H 'Connection: keep-alive' \ -H 'Pragma: no-cache' \ -H 'Cache-Control: no-cache' \ -H 'accept-api-version: protocol=2.1,resource=1.0' \ -H 'accept: application/json' \ -H 'if-none-match: *' \ -H 'x-requested-with: ForgeRock CREST.js' \ -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.80 Safari/537.36' \ -H 'content-type: application/json' \ -H 'Origin: https://am.example.com:8443' \ -H 'Referer: https://am.example.com:8443/am/ui-admin/' \ -H 'Accept-Language: en-GB,en;q=0.9' \ -H 'Cookie: amlbcookie=01; iPlanetDirectoryPro=ji_S58bZ7iuOeRgdbny74vqJK5Y.*AAJTSQACMDEAAlNLABx5S3h5SHd3Y29HT1BRZGpoaVlkQS9VbERJc2M9AAR0eXBlAANDVFMAAlMxAAA.*' \ --data-binary '{"entryNodeId":"e301438c-0bd0-429c-ab0c-66126501069a","nodes":{},"staticNodes":{}}' \ --compressed \ --insecureSee Also
How do I avoid common issues with REST calls in AM (All versions)?
Related Training
N/A
Related Issue Tracker IDs
N/A