jcp | 2018-07-20 19:10:42 UTC | #1
I am trying to add members to a group via the POST API, but struggling with the syntax. I am sure it's a basic typo somewhere, can someone have a look please ?
curl -s -X POST -H "Authorization: bearer ${token}" -H "Content-Type: application/json" -d '{"memberIds": [{"id": "78e49a62-aa84-4af1-aa0f-432ff8341b48"},{"id": "826e58cd-7f37-4ac6-bd1b-5aa8bb46493f"}],"version": 1}' "https://api.mypurecloud.ie/api/v2/groups/deb8418e-e050-406d-afe1-671b88580d61/members" | jq '.' { "status": 400, "code": "bad.request", "message": "The request could not be understood by the server due to malformed syntax.", "contextId": "f7d356df-b8ca-41e9-9376-23b957649d71", "details": [], "errors": [] }
also tried to do this via developer tool: curl -X POST -H "Content-Type: application/json" -H "Authorization: bearer <INSERT AUTH TOKEN>" -d '{ "memberIds": [ {"id": "78e49a62-aa84-4af1-aa0f-432ff8341b48"} ], "version": 1 }' "https://api.mypurecloud.ie/api/v2/groups/deb8418e-e050-406d-afe1-671b88580d61/members"
Thanks
tim.smith | 2018-07-23 14:14:37 UTC | #2
POST /api/v2/groups/{groupId}/members is documented as memberIds being an array of string. E.g. { "memberIds": [ "1234", "5678" ] }
jcp | 2018-07-25 07:03:23 UTC | #3
Hi Tim, That's great thanks for your help
system | 2018-08-25 07:03:24 UTC | #4
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 3217