Forum Discussion
cdsdefender
Aug 08, 2024Copper Contributor
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/a...
- Aug 09, 2024
jbmartin6
Aug 08, 2024Iron Contributor
Try putting double quotes around the string, or %22
- cdsdefenderAug 09, 2024Copper ContributorThanks for quick reply.
I have tried to escape single quote by using double quotes before it but still it is not working.
https://api.security.microsoft.com/api/Software/google%5Cchrome-_-queen%22%27s_closure/machineReferences
Response :
{
"error": {
"code": "BadRequest",
"message": "The key value ('google\\chrome-_-queen\"'s_closure') from request is not valid. The key value should be format of type 'Edm.String'.",
"target": "00-8605ae4708520f309608e2e73dd83887-d0613469dba4777d-00"
}
}
Also tried to escape whole word and put double quotes before whole word but not working that also.- jbmartin6Aug 09, 2024Iron Contributor
- cdsdefenderAug 12, 2024Copper Contributor
jbmartin6 this will work if ID does not contains any double quotes but any thoughts on if ID contains double quotes?