'Changes' API: identifying Merge target Person based on the source Person (rather than vice versa)
Hello
I have been analysing some merge history via the output of the Changes API, https://www.familysearch.org/platform/tree/persons/<id>/changes.
I have found that, where there has been a Merge, I can track down the source Person given the target Person, but not vice versa.
On the source Person change history, the change is just shown as 'Person Removed', with no indication that it was caused by a Merge.
The target Person's change history does show a Merge, and gives the source Person ID, but that's not much use if you are starting from the source Person.
Has anyone found a API-based way of automatically identifying the target Person given the source Person?
Thanks.
Best Answer
-
You can get the source person by doing a GET on https://www.familysearch.org/platform/tree/persons/<id>
If you get a 301 redirect, then that means that that Person ID was removed in a merge, and the redirect (in the Location header) will be to the surviving person (what you are calling the target person).
1
Answers
-
I know nothing about APIs beyond the fact that they exist, but have you tried simply going to the PID of the merge-deleted profile (which I'm guessing must be what you mean by "source Person")? That is, you can just plug the ID in at the end of https://www.familysearch.org/tree/person/details/. The second line on the black stripe across the resulting page will end with a link to the surviving profile (presumably what you mean by "target Person").
1 -
Julia - Many thanks, I can get the information in the way you suggest, but I really need to automate this.
Alan - Brilliant, thank you. I have slightly tweaked the getmyancestors Python module and am now getting exactly what I want, i.e. the target Person ID.
0 -
Mandy, apologies for my somewhat-clueless contribution. I'm glad Alan knew the answer!
(Python is more my spouse's wheelhouse than mine. I can just about keep track of two flavors of wiki markup.)
1 -
No problem at all, Julia!
0