12-17-2021 10:09 AM
Hi! I've been trying to get a REST API call to work with no luck, I wanted to get the hit counts for all rules in an ACP, I see that I need to give a Device ID but I've tried the FTD HA Pair ID, and just the devices ID and evertime I get device Id is invalid so I'm wondering if my ID is really wrong or if its a problem with the request.
Here is the request I'm doing
Device ID
{
"id": "210a246a-e468-11e8-bd5d-8ecb5cb2c3a9",
"type": "Device",
"links": {
"self": "https://x.x.x.x/api/fmc_config/v1/domain/e276abec-e0f2-11e3-8169-6d9ed49b625f/devices/devicerecords/210a246a-e468-11e8-bd5d-8ecb5cb2c3a9"
},
"name": xxxxx
REQUEST - https://x.x.x.x/api/fmc_config/v1/domain/global/policy/accesspolicies/780CF067-649A-0ed3-0000-042949674015/operational/hitcounts?filter="deviceId:{d10e2c32-ffbe-11e8-9e90-9055102fe195};fetchZeroHitCount:{false}"
For HA Pair
"items": [
{
"id": "d10e2c32-ffbe-11e8-9e90-9055102fe195",
"type": "DeviceHAPair",
"links": {
"self": "https://x.x.x.x/api/fmc_config/v1/domain/e276abec-e0f2-11e3-8169-6d9ed49b625f/devicehapairs/ftddevicehapairs/d10e2c32-ffbe-11e8-9e90-9055102fe195"
},
"name": xxxxx
REQUEST - https://x.x.x.x/api/fmc_config/v1/domain/global/policy/accesspolicies/780CF067-649A-0ed3-0000-042949674015/operational/hitcounts?filter="deviceId:{d10e2c32-ffbe-11e8-9e90-9055102fe195};fetchZeroHitCount:{false}"
Got the same response using explorer
Solved! Go to Solution.
01-18-2022 08:45 AM
I don't have a good setup for testing this but I found on my box when I had the curly braces around the device ID I saw the same problem you are hitting. When I removed that I don't see the same error about device ID.
I just did a filter like this:
deviceId:7ed2e4e2-590e-11ec-83fb-86a1d0ba83f9
I see the design document had a similar example so I think the curly braces are more just to separate in the documentation but shouldn't be passed from what I can tell.
01-18-2022 09:08 AM
That was it! Thank you so much! and it was so simple hahahaha
01-18-2022 08:45 AM
I don't have a good setup for testing this but I found on my box when I had the curly braces around the device ID I saw the same problem you are hitting. When I removed that I don't see the same error about device ID.
I just did a filter like this:
deviceId:7ed2e4e2-590e-11ec-83fb-86a1d0ba83f9
I see the design document had a similar example so I think the curly braces are more just to separate in the documentation but shouldn't be passed from what I can tell.
01-18-2022 09:08 AM
That was it! Thank you so much! and it was so simple hahahaha
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide