APIs & Services
Relationship API
12 min
the relationships api can be used to see how you and your users can best connect to the people and organization in the altrata dataset it can also be used to see how these people and organizations connect to each other my paths to person and organization the mypathstoperson and mypathstoorganization can be used to retrieve paths from the current user to a target person or organization respectively these paths are ordered by relevance, with the strongest paths returned first the paths can begin in one of two ways from an altrata person that the current user has added a contact on the altrata platform from an altrata person that another user under the same account has added a contact on the altrata platform if you have authenticated as a service user, only the later will be avalible as service users are unable to add contacts themselves 1st degree connection if the altrata person who has been added as a contact is the target person, or currently works at the target organization, then this is a 1st degree connection 1st degree connections will always be returned first when the contact has been added by the current user 2nd degree connection if the altrata person who has been added as a contact has a relationship with the target person, or a person who currently works at the target organization, then this is a 2nd degree connection person network the person network query can be used to find all the people a given person has a relationship with these connections will always be at the 1st degree , giving you a complete picture of all the people the source person has worked with over their career pathfinder the api also contains queries to find paths between two entities currently the following permutations are supported person paths to person returns how one altrata person can connect to another if the source person has a relationship with the target person, this is a 1st degree connection if the relationship goes via an intermeditary person, this is a 2nd degree connection person paths to organization returns how an altrata person can connect to an altrata organization if the person currently works at the organization, this is a direct connection if the person has a relationship with someone who works at the organization, this is a 1st degree connection if the person has a relationship with an intermeditary person who themslves knows somone who works at the organization, this is a 2nd degree connection organization paths to organization returns how one altrata organization can connect to another if one person currently works at both the source and target organizations, this is a direct connection if a person who currently works at the source organization has a relationship with a person two currently works at the target organization, this is a 1st degree connection my paths to person returns how the current user can connect to an altrata person, either via their own contributed contacts or their colleagues contacts if the target person has been added as a contact by the current user or one of their colleages, this is a 1st degree connection if the target person has a relationship with a person who has been added as a contact by the current user or one of their colleages, this is a 2nd degree connection my paths to organization returns how the current user can connect to an altrata organization, either via their own contributed contacts or their colleagues contacts to a person who works at the organization if a person who works at the target organization has been added as a contact by the current user or one of their colleages, this is a 1st degree connection if a person who works at the target organization has a relationship with a person who has been added as a contact by the current user or one of their colleages, this is a 2nd degree connection example queries this document provides usage examples for the relationships api mypathstoperson find the relationship paths from the authenticated user to a specific person query { mypathstoperson( personid "1 per 39571767" userrelationshiptype \[contact, colleague] pageinfo { after 0 first 10 } ) { on mypathstopersonresponse { start { id firstname lastname email } target { id name roleprimarytitle email } paths { on firstdegreeusertopersonpath { entity1 { id firstname lastname } relationship1 { score relationshipstrength contactrelationshipstype } } on seconddegreeusertopersonpath { entity1 { id firstname lastname } relationship1 { score relationshipstrength } entity2 { id name } relationship2 { score relationshipstrength overlaptypes } } } pageinforesponse { totalcount pageinfo { endcursor } } } on genericerror { genericerrorcode errormessage correlationid } on usernotfounderror { usernotfounderrorcode errormessage correlationid } on targetnotfounderror { targetnotfounderrorcode errormessage correlationid } on authorizationerror { errormessage correlationid authorizationerrorcode } } } mypathstoorganization find relationship paths from the authenticated user to a specific organization query { mypathstoorganization( organizationid "1 org 756705" userrelationshiptype \[contact, colleague] pageinfo { after 0 first 10 } ) { on mypathstoorganizationresponse { start { id firstname lastname email } target { id name isrestricted } paths { on firstdegreeusertoorganizationpath { entity1 { id firstname lastname } relationship1 { score relationshipstrength } entity2 { id name } relationship2 { score relationshipstrength roletitle email } } on seconddegreeusertoorganizationpath { entity1 { id firstname lastname } relationship1 { score relationshipstrength } entity2 { id name } relationship2 { score relationshipstrength overlaptypes } entity3 { id name } relationship3 { score relationshipstrength roletitle } } } pageinforesponse { totalcount pageinfo { endcursor } } } on genericerror { genericerrorcode errormessage correlationid } on usernotfounderror { usernotfounderrorcode errormessage correlationid } on targetnotfounderror { targetnotfounderrorcode errormessage correlationid } on authorizationerror { errormessage correlationid authorizationerrorcode } } } getoverlapdetails get detailed information about overlaps between pairs of people query { getoverlapdetails( input \[ { personid1 "1 per 42076243", personid2 "1 per 39571767" } { personid1 "1 per 44346368", personid2 "1 per 39571767" } ] ) { on overlapdetailsresponse { overlapdetails { person1 { id name roleprimarytitle } person2 { id name roleprimarytitle } overlap { score overlaptypes relationshipstrength additionalinfo } detailsbyorganization { organization { id name } duration { length unit isapproximate } details { person1roletitle person2roletitle startdate { date dateprecision displaydate } enddate { date dateprecision displaydate } status } } } missingoverlaps { personid1 personid2 } } on genericerror { genericerrorcode errormessage correlationid } on targetnotfounderror { targetnotfounderrorcode errormessage correlationid } } } personnetwork get the network of first degree connections for a person query { personnetwork( sourcepersonid "1 per 39571767" userrelationshiptype \[contact, colleague] relationshipstrengths \[strong, medium] pageinfo { after 0 first 20 } ) { on personnetworkresponse { start { id name roleprimarytitle email } paths { on firstdegreepersontopersonpath { relationship1 { score overlaptypes relationshipstrength additionalinfo } entity1 { id name roleprimarytitle email } } } pageinforesponse { totalcount pageinfo { endcursor } } } on genericerror { genericerrorcode errormessage correlationid } on sourcenotfounderror { sourcenotfounderrorcode errormessage correlationid } on authorizationerror { errormessage correlationid authorizationerrorcode } } } personpathstoorganization find relationship paths from a person to an organization query { personpathstoorganization( sourcepersonid "1 per 39571767" targetorganizationid "1 org 756705" pageinfo { after 0 first 10 } ) { on personpathstoorganizationresponse { start { id name roleprimarytitle email } target { id name isrestricted } paths { on directpersontoorganizationpath { relationship1 { score relationshipstrength roletitle email } } on firstdegreepersontoorganizationpath { relationship1 { score overlaptypes relationshipstrength } entity1 { id name roleprimarytitle } relationship2 { score relationshipstrength roletitle } } on seconddegreepersontoorganizationpath { relationship1 { score overlaptypes relationshipstrength } entity1 { id name } relationship2 { score overlaptypes relationshipstrength } entity2 { id name } relationship3 { score relationshipstrength roletitle } } } pageinforesponse { totalcount pageinfo { endcursor } } } on genericerror { genericerrorcode errormessage correlationid } on sourcenotfounderror { sourcenotfounderrorcode errormessage correlationid } on targetnotfounderror { targetnotfounderrorcode errormessage correlationid } on authorizationerror { errormessage correlationid authorizationerrorcode } } } organizationpathstoorganization find relationship paths between two organizations query { organizationpathstoorganization( sourceorganizationid "1 org 756705" targetorganizationid "1 org 9563464" pageinfo { after 0 first 10 } ) { on organizationpathstoorganizationresponse { start { id name isrestricted } target { id name isrestricted } paths { on directorganizationtoorganizationpath { relationship1 { score relationshipstrength roletitle } entity1 { id name roleprimarytitle } relationship2 { score relationshipstrength roletitle } } on firstdegreeorganizationtoorganizationpath { relationship1 { score relationshipstrength roletitle } entity1 { id name } relationship2 { score overlaptypes relationshipstrength } entity2 { id name } relationship3 { score relationshipstrength roletitle } } on seconddegreeorganizationtoorganizationpath { relationship1 { score relationshipstrength roletitle } entity1 { id name } relationship2 { score overlaptypes relationshipstrength } entity2 { id name } relationship3 { score overlaptypes relationshipstrength } entity3 { id name } relationship4 { score relationshipstrength roletitle } } } pageinforesponse { totalcount pageinfo { endcursor } } } on genericerror { genericerrorcode errormessage correlationid } on sourcenotfounderror { sourcenotfounderrorcode errormessage correlationid } on targetnotfounderror { targetnotfounderrorcode errormessage correlationid } on authorizationerror { errormessage correlationid authorizationerrorcode } } }


