Copy const query = 'query GetApiSecurityFiltersLazy($getApiSecurityInput: GetApiSecurityInput) { getApiSecurityFiltersLazy(getApiSecurityInput: $getApiSecurityInput) { total totalFiltered filters { type items { id filterId label count percent changeNumber policyId extraInfo { key value } } } } }';
fetch("https://api.cloud.ox.security/api/apollo-gateway", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": "YOUR_API_TOKEN"
},
body: JSON.stringify({
query: query,
// This is an example input showing all available input fields. Only fields marked as required in the schema are mandatory.
variables: {
getApiSecurityInput: {
scanId: "c9da693d-8906-4a32-93c9-2ffdb1cebb99",
offset: 0,
limit: 100,
owners: ["example"],
tagIds: ["example"],
search: "/api/v2/",
filters: {
apps: ["repo-name"],
appIds: ["1234567890"],
titles: ["Kubernetes"],
endpoints: ["/api/v1/some/endpoint"],
methods: ["GET"],
framework: ["OpenAPI"],
languages: ["OpenAPI"],
issueIds: ["30966426-oxPolicy_securityCloudScan_100-example"],
apiId: ["ceb76dd8-7c11-448c-9056-17c5b5bfa361"],
source: ["OpenAPI"],
severities: ["2"],
reachability: ["Code"],
appTags: ["Private repo"]
},
filterSearch: [
{
fieldName: "example",
value: ["example"]
}
],
openItems: ["digest"],
orderBy: {
field: "title",
direction: "ASC"
}
}
}
})
})
.then(response => response.json())
.then(result => console.log(JSON.stringify(result, null, 2)))
.catch(error => console.error('Error:', error));