How to query Defender 'List devices by recommendation' API with a '/' in the ID

Peter 10 Reputation points
2023-02-28T17:07:02.7233333+00:00

I have a list of recommendations from the Defender for Endpoint API https://api.securitycenter.microsoft.com/api/recommendations

I want to retrieve the list of devices for each recommendation via https://api.securitycenter.microsoft.com/api/recommendations/{id}/machineReferences

However, one of the recommendations in the list from my first API call has an ID of "va--oracle--mysql_connector/j"

Clearly passing an id containing a "/" to the machineReferences endpoint is invalid. Please could someone tell me how to query on this ID (and any others formatted in this way)?

Thanks.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,445 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Peter 10 Reputation points
    2023-03-01T10:53:16.8166667+00:00

    OK, this was actually an easy one. I just need to ASCII encode the / character :)

    0 comments No comments