API Discussions
Discussions and questions regarding the Cato Networks APIBest Practices
Find Cato Network API best practices, tips, and tricks
Recent Content
New KB article: detailed explanation of accountMetrics timeseries
This article explains how to request a timeseries metric and more importantly, how to interpret the results so that you can create a throughput chart in Excel which matches the graphs seen in CMA. https://support.catonetworks.com/hc/en-us/articles/25296975130525-Example-Site-Bandwidth-with-accountMetrics-API2Views0likes0CommentsAccountMetrics - Cannot query field "tunnelAge" on type "Metrics"
We would like to query connectivity metrics using the accountMetrics API. This works as expected for metrics such as bytesUpstream, bytesDownstream. However, it fails for some other metrics such as tunnelAge and lastMilePacketLoss. Request URL: https://api.catonetworks.com/api/v1/graphql2 Request body: { "query": "{ accountMetrics(accountID:XXXX timeFrame: \"utc.xxxx/{15:50:00--16:00:00}\" groupInterfaces:false groupDevices:false) { sites { interfaces { metrics { tunnelAge } timeseries(buckets: 10 labels: [tunnelAge]) { data label units } } } } }" } Exception: 422 Unprocessable Entity { "errors": [ { "message": "Cannot query field \"tunnelAge\" on type \"Metrics\".", "locations": [ { "line": 1, "column": 157 } ], "extensions": { "code": "GRAPHQL_VALIDATION_FAILED" } } ], "data": null } According to the documentation, this should work: Cato API - AccountMetrics > Timeseries – Cato Learning Center Why is it that this request does not work for 'tunnelAge' but does work for 'bytesUpstream'?Solved21Views0likes2CommentsHow do I filter AccountSnapshot by site?
Hy everyone, I'm trying to filter the ‘AccountSnapshot’ results by site. I'm trying to use the ‘siteIDs’ field to target a site. I tried using the IDs in "AccountSnapshot > sites > id" but it's failed. However, all the IDs I've used don't work. Do you know what GraphicQL query I can use to find this ‘siteIDs’? Thank for your timeSolved43Views0likes4CommentsFor Beta queries
When I query for revisions in InternetFirewallPolicyQueries, I get the error "Operation Failed: received non-200 OK status code [500]. Is there any solution? I have confirmed that the AccountID is correct, but this query is still in Beta version, so I think it might not be able to execute yet.51Views0likes3CommentsAPI Request to get all SDP users
Hi everyone, I'm trying to get all users within my Cato platform. Like in Access > Users when you select SDP Users Activity. I cannot find any direct way to do it, maybe i'm missing something ? I tried with AccountSnapshot but here you can only find connected users, it is also stated that if I want users that are offline I need to specify the ID, is it the only way to do it ? Thanks, BillySolved94Views0likes5CommentsIs "CORS Preflight Request" supported?
Hello team, Is the CORS preflight request is supported in cato api server? When I query from browser by javascript, the preflight request was blocked by CORS policy. ーーーーー Access to XMLHttpRequest at 'https://api.catonetworks.com/api/v1/graphql2' from origin 'http://localhost:4000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. ーーーーー What I want to know is if this is normal behavior or a problem with my program. Thank you,Solved43Views0likes2Comments