getManagedEndpointDetails
I am trying to use the Control Center API to get the details about an endpoint from GravityZone. I've got all the basics working. I generated the API key and I am able to authenticate and query data. Now I am trying to use the code at the bottom of this message to get the details about an endpoint. (For brevity, I left out the code that uses the API Key to generate the Auth header ($auth_header), but I know that's working since I'm able to get results from my queries.) In the example below, I substituted the Id that is returned from getNetworkInventoryItems into $endpointId.
$request_uri = "https://cloud.gravityzone.bitdefender.com/api/v1.0/jsonrpc/network"
$gMED= '{
"params": {
"endpointId": "'aabbccddeeff11223344'"
},
"jsonrpc": "2.0",
"method": "getManagedEndpointDetails",
"id": "301f7b05-ec02-481b-9ed6-c07b97de2b7b"
}'
$params = @{
Uri = $request_uri
Headers = @{
'Authorization' = "$authheader"
'Content-Type' = "application/json"
}
Method = 'POST'
Body = $gMED
ContentType = 'application/json'
}
$response = Invoke-RestMethod @params
No matter what I use for the endpointId, $response.error.data always contains "Syntax error, malformed JSON." I copied the JSON parameters straight from the documentation and it looks correct, but maybe I am overlooking something. I have code for endpoints like getNetworkInventoryItems working great, but not this one.
Can you help me figure this out?
Answers
-
Hello Jeff,
Please replace the relevant section from your request with the following format :
In the future you can use https://jsonlint.com/ to validate your JSON format.
I checked our documentation https://www.bitdefender.com/business/support/en/77209-128484-getmanagedendpointdetails.html and I saw that there are some small syntax errors. I will take this with our documentation team to have it resolved.
After trying the above solution, if you are still facing an issue with your query please reach out to our Enterprise Support Team and they will be more than happy to assist you.
Thank you,
Andrei
1