client.summary_person(root.father.id, :ancestors=>MAX_ANCESTORS)
Is there a way to do that in the new api?
Karmen
Grabbing ancestors with the :ancestors => #) was very helpful for
controlling how many levels of the pedigree you wanted. If you don't
have that functionality v2 then I'll need to implement my own for my
purposes.
Let me know when you can. Thanks.
Karmen
v2 has an endpoint /familytree/v2/pedigree that allows you to pull up
to 4 generations of ancestors in one call. The data returned is
minimal (id, name, gender, version, living, parent IDs).
This is basically used for grabbing a fast snapshot of the pedigree
for drawing to the screen. If you want more detailed information, you
would need to do a person read to get the full details.
I haven't implemented this yet in the ruby-fs-stack.
As to the ancestors parameter on a person read, there isn't such thing
in v2.
--
Jimmy
Thank you!
Karmen
On Jan 25, 2:06 pm, Jimmy Z <jimmy.zimmer...@gmail.com> wrote:
> Hi Karmen,
>
> v2 has an endpoint /familytree/v2/pedigree that allows you to pull up
> to 4 generations of ancestors in one call. The data returned is
> minimal (id, name, gender, version, living, parent IDs).
>
> https://devnet.familysearch.org/docs/api-manual-reference-system/fami...
response = @client.get("https://api.familysearch.org/familytree/v2/
pedigree/#{ref}?ancestors=4&#{@session}")
I get an error:
GET //api.familysearch.org/familytree/v2/pedigree/KLY6-WQP?
ancestors=4&&sessionId=USYSB423897058617D94B9EB69BE8A706291.paam-002-067&dataFormat=application/
json
accept: */*
user-agent: Ruby-Fs-Stack/v.1 (JimmyZimmerman) FsCommunicator/0.1
(Ruby)
SocketError (getaddrinfo: nodename nor servname provided, or not
known):
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/http.rb:560:in `initialize'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/http.rb:560:in `open'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/http.rb:560:in `connect'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/timeout.rb:53:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/timeout.rb:93:in `timeout'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/http.rb:560:in `connect'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/http.rb:553:in `do_start'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/
1.8/net/http.rb:542:in `start'
/Library/Ruby/Gems/1.8/gems/ruby-fs-stack-0.4.2/lib/ruby-fs-stack/
fs_communicator.rb:81:in `get'
Do you see where I am going wrong?
Karmen
On Jan 25, 2:06 pm, Jimmy Z <jimmy.zimmer...@gmail.com> wrote:
> Hi Karmen,
>
> v2 has an endpoint /familytree/v2/pedigree that allows you to pull up
> to 4 generations of ancestors in one call. The data returned is
> minimal (id, name, gender, version, living, parent IDs).
>
> https://devnet.familysearch.org/docs/api-manual-reference-system/fami...
Try the following:
response = @client.get("/familytree/v2/pedigree/#{ref}?ancestors=4")
the @client will take care of the session as long as it has it set:
@client.session = @session
The @client also takes care of the domain if it is set.
--
Jimmy
Looking at other tidbits of your code (thanks github) I was able to do
something like this:
familytree =
Org::Familysearch::Ws::Familytree::V2::Schema::FamilyTree.from_json
(JSON.parse(response.body))
not sure if FamilyTree is the correct object to use but gives me back
something that might be usable. I tried to call persons off of the
familytree but got nil. So I'm looking into how to best grab father,
mother, grandfather, grandmother, etc. from the familytree object.
one step at time... Thanks for your help.
Karmen
On Jan 25, 4:03 pm, Jimmy Z <jimmy.zimmer...@gmail.com> wrote:
> Hi Karmen,
>
familytree =
Org::Familysearch::Ws::Familytree::V2::Schema::FamilyTree.from_json
(JSON.parse(response.body))
pp familytree.pedigrees.first
than I can grab id or persons off of that.
Next: extrapolate what I need...
Karmen
familytree.pedigrees contains a list of pedigree results (you can
request up to 2 pedigrees per API call).
Each Pedigree object should have a "persons" array, which contains
plain person records as you are used to reading from the person read.
The information contained in the person is minimal (as mentioned
earlier), but it will have a parents array containing one parent set.
I believe the following will give the ID of the primary person's
father.
familytree.pedigrees.first.persons.first.parents.first.parents[0].id
familytree.pedigrees.first.persons.first.parents.first.parents
[0].gender #=> should be 'Male'
The "persons" array is an array of all people in that X generation
pedigree. It will not be nested, but will give references to the
parents.
I hope this helps.
Jimmy
I appreciate the help.
Karmen