I am trying to move an endpoint from one group to another using the API. I have it all setup, I think, but when I do send the request I get an error from curl that it can't open the json I am sending. According to the API docs, this
curl --request POST \
'api-{dataRegion}.central.sophos.com/.../endpoints' \
--header 'Authorization: Bearer [YOUR_AUTH_INFO]' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"ids":[]}' \
--compressed
Errors out on the ids string.
curl.exe : curl: Failed to open {"ids": ["xxxxxx-xxxx-xxxx-xxxx-xxxxxxx"]}
here is my interpretation in Powershell
$Tenants = curl.exe -XPOST -H "Authorization: Bearer $jwt" "X-Tenant-ID: $Tenant_id" "$URL" "Accept: application/json" "Content-Type: application/json" -D $machines -compressed
Where $Machines looks like this: {\"ids\": [\"xxxxxx-xxxx-xxxx-xxxx-xxxxxxx\"]}
Anybody else able to get a curl post to work? Any idea what is wrong with my example?
Do I need to convert to json while doing the curl call or before?
Updated the tags
[edited by: Gladys at 2:36 PM (GMT -8) on 1 Jan 2024]