mdavid | 2024-07-25 05:42:35 UTC | #1
Why does this syntax work (found this on a previous thread) echo '[{"id": "6e1f6fc4-a6b3-44de-9ac7-a1234532e7f", "acdAutoAnswer": true}]' | gc.exe users bulk update
But not this? To me, its identical. @{ "id"="6e1f6fc4-a6b3-44de-9ac7-a1234532e7f"; "acdAutoAnswer"= 'true'; } | ConvertTo-Json | gc.exe users bulk update
Error: "message": "The request could not be understood by the server due to malformed syntax.", "code": "bad.request", "status": 400, "contextId": "0e5272d9-47f7-4a55-9fc8-f8799550cec6", "details": [], "errors": []
Jerome.Saint-Marc | 2024-07-25 08:42:58 UTC | #2
Hello,
The bulk update command expects a JSON array as input -> the square brackets [{"id": "6e1f6fc4-a6b3-44de-9ac7-a1234532e7f", "acdAutoAnswer": true}, {"id": "5d1f6fc4-1234-44de-9ac7-a1234532e7f", "acdAutoAnswer": true}, ...] or with 1 element inside: [{"id": "6e1f6fc4-a6b3-44de-9ac7-a1234532e7f", "acdAutoAnswer": true}]
Your command sends a single JSON object - not an array of JSON objects.
Regards,
mdavid | 2024-07-26 16:14:10 UTC | #3
Thanks for the clarification!
system | 2024-08-25 16:14:37 UTC | #4
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 27394