Update User's group participation api V2.2
I'm trying to update a user's group participation via the put endpoint /accounts/{accountId}/contacts/{contactId}. I'm getting a 200 returned, but the returned model doesn't reflect the attempted updates. Any advice is appreciated. The following is the relevant section of json for the update.
"FieldValues": [{
"FieldName": "Group participation",
"Value": [
{
"Id": 559646,
"Label": "tmpCardGroup"}],
"SystemCode": "Groups"
}]
Feel free to comment if your issue remains unresolved
-
Nathaniel Lyttle commented
@Ian, my issue was I was using http instead of https. The endpoint returns a 200 even though http only supports read-only! If you're using an https request there was a bug where the put didn't return the updated model, so do a subsequent get request. If it still fails we're having different issues!
-
Ian Shields commented
@nate Can you explain a bit what the resolution of this was? I have a similar issue and seeing that I reported here. https://forums.wildapricot.com/forums/309658-developers/suggestions/41056405-update-contact-put-endpoint-not-updating-custom
-
nate commented
The attached file is what I have for testing. I've attempted several different variations for the sent data. The docs says "Values for read-only or unrecognized fields will be ignored.", This may be the source of my problem, but there's no way I've found to verify if that's the cause as I don't get an invalid parameter error.
-
nate commented
Thanks for the quick reply. It appears the model isn't updating at all. Additional GET requests return the same thing as the PUT request returns.
Can you elaborate on what is and is not a necessary field? Sending the following alone results in a 200, but no update. I can post my code it that's helpful?
{
'FieldValues':[
{'SystemCode':'Groups',
'Value':[{
'Id': 559646,
'Label':'tmpCardGroup'
}]
}]
}sidenote: is there advice somewhere on posting indented code without getting a whole bunch of "?
-
Hello!
I can see the strange behavior of the API: If you provide a FieldName than in the returned model you can't see changes in the GroupParticipation field. So, you can do two things: 1. Strip unnecessary fields (you need only Value-Id and SystemCode ones) or 2. Make additional GET request after completing PUT.