List software inventory API – Returns a 400 error if software_id contains a single quote.
I am using following API to get list of devices using software_id.
https://learn.microsoft.com/en-us/defender-endpoint/api/get-machines-by-software
GET https://api.securitycenter.microsoft.com/api/Software/microsoft-_-edge/machineReferences
I have a software_id that contains a single quote: googlechrome-_-maryland’s_road_closure_reporter
I have URL encoded it to pass into the API. After encoding, it becomes: google%5Cchrome-_-maryland%27s_road_closure_reporter
Now my api call looks like this :
In response i am getting following error.
I have checked that this is an issue with the single quote, and the API is not handling it correctly.
Can someone please help me resolve this issue? Is this a limitation of the API?
I am using following API to get list of devices using software_id. https://learn.microsoft.com/en-us/defender-endpoint/api/get-machines-by-softwareGET https://api.securitycenter.microsoft.com/api/Software/microsoft-_-edge/machineReferences I have a software_id that contains a single quote: googlechrome-_-maryland’s_road_closure_reporterI have URL encoded it to pass into the API. After encoding, it becomes: google%5Cchrome-_-maryland%27s_road_closure_reporter Now my api call looks like this : https://api.security.microsoft.com/api/Software/google%5Cchrome-_-maryland%27s_road_closure_reporter/machineReferences In response i am getting following error. {“error”: {“code”: “BadRequest”,”message”: “The key value (‘google\chrome-_-maryland’s_road_closure_reporter’) from request is not valid. The key value should be format of type ‘Edm.String’.”,”target”: “00-18cb5c3c4880e2df7e606358b4e825ab-ac6e7d51804be7dd-00”}} I have checked that this is an issue with the single quote, and the API is not handling it correctly.Can someone please help me resolve this issue? Is this a limitation of the API? Read More