Sophos EndPoint API - Bad Request

Hi, I need help.

I am making a script in the python programming language to be able to load a list of applications that I want to control (2670 applications, approximately).

Resource: api-{dataRegion}.central.sophos.com/.../settings

I have two problems, the first:

When loading all the applications, I have the following message in response.

{
"error": "badRequest",
"correlationId": "6627f05f-c314-4a37-97e4-3c2d1606385a",
"requestId": "eff02867-d685-4469-a961-a48e8e661bc7",
"message": "Setting value must match the pattern ^[-\\p{L}\\p{Nl}\\d ,!()\\\\/.\"':?#$+]*$ "
}

Reviewing the list of applications, there are some names that do not comply with the pattern, for example:

"YTD YouTube Downloader & Converter"
"Microsoft Snip & Sketch"

The error is due to the "&" symbol.

What should I do to load those applications through the script, without having that error message?
What other character can I replace it with? Since the names described above are as they are in the list of programs in Sophos EndPoint.

Second problem:
Repeating the tests, now without those program names, I have the following error message, without having more information about it.

{
"error": "BadRequest",
"correlationId": "2f7d676e-bf58-4aa7-9c91-6d9b772ff73d",
"requestId": "c11a0583-be50-4cf1-a1d6-dc9bdc8cbbd0"
}

At first I thought the problem was due to some error in the code, but it is not, I have done other tests with just a program name and it works correctly, but I need to block the 2670 described at the beginning of the message.

Thank you



Edit Tags
[edited by: GlennSen at 3:00 AM (GMT -8) on 30 Jan 2024]