Endpoint Protection Mobile

 View Only

 API for SEP Mobile

Jump to Best Answer
Pawel Lesniewski's profile image
Pawel Lesniewski posted May 04, 2023 04:55 AM

Hello 

Has anybody successfully conected to API as in title at your organization?
I'm trying to exec PS script and I've received response "Cannot send a content-body with this verb-type".

API reference ("https://api.sepmobile.securitycloud.symantec.com/help/API.html") is not clear for me :). 

Can you tell me what is the body format, and what I'm doing wrong.

Thank you in advance.
-- 
Pawel


$SEPMob_root = "https://eu-mc1-api.sepmobile.securitycloud.symantec.com"

$headers = @{'API-VERSION' = '1.1'}
$body = '{"auth_token":"someRandomChars", "organization_id":"{someRandomDigits}"}'

Invoke-WebRequest -uri "$SEPMob_root/organizations/{someRandomDigits}/statistics" -method GET -headers $headers -body $body 

Pawel Lesniewski's profile image
Pawel Lesniewski Best Answer
$url = "https://eu-mc1-api.sepmobile.securitycloud.symantec.com"
$org_id = "987654321098"
$auth_token = "ABCDEFghijklmnop12#$"

$headers = @{'API-VERSION' = '1.1'}
$body = @{'auth_token' = $auth_token}

$response = Invoke-WebRequest -Uri "$url/organizations/$org_id/statistics" -Method Get -Headers $headers -Body $body
$responseJSON = ConvertFrom-Json $response.Content

write "General"
write ("Devices: " + $responseJSON.data.statistics.general.devices.total)
write ("Active:   " + $responseJSON.data.statistics.compliance.compliant)