I am trying to create a new GroupMember via the REST API. My payload looks like:

{ "GroupId": "00Gj00000016xpyEAA", "UserOrGroupId": "005j000000C8xj6AAB" }

and the response I get:

[ { "message": "field integrity exception: unknown (invalid user or group: 005j000000C8xj6)", "errorCode": "FIELD_INTEGRITY_EXCEPTION", "fields": [ "unknown" ] } ]

It looks like the last 3 chars of the UserOrGroupId are being truncated. Anyone know if this is a known problem, or am I just not doing it right?

  • The last 3 chars are only used if the id is case insensitive. They are not needed. Is the group you are adding to a Customer Community Group? Apr 20 '15 at 19:04
  • I think CaspNZ is right. You should use 15 digit case sensitive id. help.salesforce.com/apex/… Apr 20 '15 at 19:27
  • When I use the api to request all users, the AAB is part of the ID on that one, that I get back from SalesForce. The group is a new Public Group that I created previously and is now 'known'. Since it is SalesForce saying that it cannot find the 15-char user id, asking it to do so does not seem like the way to go but I did try that - same result. Apr 21 '15 at 16:00

The api I POSTed to is: https://myinstance.salesforce.com/services/data/v36.0/sobjects/GroupMember. I was finally able to get it to work with no changes to payload, after I changed the user's profile to something other than 'Chatter Free User'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.