-
Notifications
You must be signed in to change notification settings - Fork 132
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NGPVAN -- update_person_json function doesn't update person record #673
Comments
Hey! I'm also working on a script that uses this function. Can you tell me what the expected output is? I've used this function in previous scripts at Sunrise with success |
So from my understanding of the documentation, I would think that the function should edit the person's record with whatever has been provided to
(the codes field now is blank and all codes have been wiped). Let me know if any of my understanding around this function is off. I'm also a little confused because it seems that the |
This is what my code looks like
I'm going to play around and see if I can verify that I'm updating the record |
Alright, thank you, please let me know! |
I attempted to opt myself in and out of our SMS list and when I checked my record, my PhoneOptInStatus was still "Unknown". This is odd because I worked with TMC to build this script a year or so ago and was under the impression that it worked. |
Yes, this is essentially the problem I'm having. It's very odd because the endpoint should allow you to update a record if you provide an existing VANID, but that doesn't appear to be working for any field based on your example. So now I'm not sure if it's an issue with Parsons or the endpoint itself. |
Hi folks, TL;DR: I think there might not actually be a bug here. I wanted to report that I was able to update a phone's opt in using @thebbennett's exact code. I even tested it with a stringified phone number, and even with dashes, suggesting that EA strips way non-digits in the API call to the So with that in mind, along with other recent API changes, I can confirm that I was also unable to add or remove Codes using the I think, then, the problem may just be that we have no ability to ask for expanded arrays in responses from the |
I haven't had a chance to look into this too deeply, but the |
I think this issue is just that the relationships are not updateable from the update_person endpoint. We have two paths we could go depending on how general-case we want to do:
I think adding/deleting array/list objects might be frought -- e.g. if you think you're 'adding a code' by doing a for-loop on a bunch of IDs and codes=[{'codeId': 1002611....}] then you might not realize that you're actually removing all other codes from those users -- so I suggest we error out instead and provide separate api to |
The update_person_json() function does not seem to function as the documentation indicates. When I use the function to attempt to update a contact (in the demo EA site using a sandbox the EA team setup for me) in the following way:
van = VAN(db='MyCampaign') van.update_person_json(id=101991312, match_json={'codes':None})
I get a strange JSON output that is completely different from the actual person's record (it is shown below)
But if I run
van.get_person(id=101991312)
I get the following which proves that the above JSON is not reflecting the updated record of the person
When I walked through this issue with Shauna from the Parsons team she pointed out that this command doesn't appear to hit an endpoint for the API that would delete or update a contact's record according to Parson's documentation for the update_person_json() method. It appears that the documentation is incorrect or this function is not working exactly as it should.
Just for reference, this is the API's page of documentation that provides code which successfully (I have tested it and it works) deletes codes off of contacts' records, and this is the [page of the documentation]( for the API that is linked for the update_person_json() parson method.
The text was updated successfully, but these errors were encountered: