cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
904
Views
1
Helpful
4
Replies

how to fetch the top talkers from fmc via rest api

rejad123
Level 1
Level 1

how to fetch the top talkers from fmc via rest api

we have enabled the rest api from the fmc and we are trying to fetch the top talkers from postman with providing the auth-token and the domainUUID

https://{{fmc_ip}}/api/fmc/v1/topTalker?count=10

But we are getting the error code 404 

 

Can you please suggest me the correct URI or any missing configuration from FMC Side

 

4 Replies 4

marce1000
VIP
VIP

 

  - You basically have a permission denied problem , checkout this procedure and look for alternative ways in which the authentication is established :

Get the API key for your FMC. You can find this in the FMC web UI under Administration > System > API Keys.
Create a new HTTP request using your favorite REST client.
Set the request URL to https://<FMC_IP_ADDRESS>/api/v1/top-talkers.
Set the request headers to include the following:
Authorization: Bearer <API_KEY>
Content-Type: application/json
Set the request body to a JSON object with the following properties:
topN: The number of top talkers to return.
timespan: The timespan for which to return the top talkers.
Send the request.
The response will be a JSON object with a list of the top talkers.
Here is an example of an HTTP request that you can use:

GET https://192.168.1.1/api/v1/top-talkers
Authorization: Bearer 1234567890abcdef
Content-Type: application/json

{
"topN": 10,
"timespan": "1h"
}
The response to this request will be a JSON object with the following properties:

topTalkers: A list of the top talkers. Each top talker is a JSON object with the following properties:
source: The source IP address of the top talker.
destination: The destination IP address of the top talker.
bytes: The number of bytes sent by the top talker.
packets: The number of packets sent by the top talker.
Here is an example of a response from the FMC:

{
"topTalkers": [
{
"source": "192.168.1.1",
"destination": "192.168.1.2",
"bytes": 1000000,
"packets": 10000
},
{
"source": "192.168.1.2",
"destination": "192.168.1.1",
"bytes": 500000,
"packets": 5000
},
{
"source": "192.168.1.3",
"destination": "192.168.1.4",
"bytes": 250000,
"packets": 2500
}
]
}



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

Dear Marce , 

We are using the fmc version 7.1.0 and i believe the Administartion Tab is available from where we can get the API Keys

Could you please   provide me an alternate way where i can fetch the top talkers via rest api

i have executed with GET https://{{fmc_ip}}/api/fmc/v1/monitor/top-talkers

with Header 

Accept appilication/json

X-Auth-Token - {{auth_token}}

But still we are getting error with description - "The server has not found anything matching the request URI"

I wonder if this has been removed or is not present in your and my version of the fmc, as I also get a 404 error when trying:

https://172.x.x.x/api/fmc/v1/monitor/top-talkers 

https://172.x.x.x/api/fmc/v1/top-talkers 

https://172.x.x.x /api/fmc_config/v1/domain/" + auth_domain + "/monitor/top-talkers 

https://172.x.x.x /api/fmc_config/v1/domain/" + auth_domain + "/top-talkers 

My API is expecting calls which I can get a response from in the following format:

https://172.x.x.x/api/fmc_config/v1/domain/" + auth_domain + "/devices/devicerecords
 
If anyone can advise I would be most grateful
 
I am using FMC 7.0.5 and Cisco Firepower Management Center Open API Specification 1.0.0
Review Cisco Networking for a $25 gift card