# GetContactByID - Advanced Documentation ## Overview Retrieves a complete contact record by ID - the primary endpoint for loading full contact details. Returns persons and companies with all associated data. Ad hoc fields are filtered by the current user's role-based view permissions. ## What's Included The `BaboContactInfo` return contains: ### Core Fields - ID, FirmID, Name, DisplayName, GlobalID, CompanyGUID - IsPerson (boolean - person vs. company) - Prefix, FirstName, MiddleName, LastName, Suffix - DateOfBirth, DateOfDeath, SocialSecurityNumber - WebSite, PreferredContactMethod, TaxNumber - RepresentationStatus, Timestamp ### Contact Methods (with primary identification) - **Addresses** - list with type, primary flag - **Phones** - list with type, primary flag - **Emails** - list with type, primary flag ### Related Data - **Tags** - contact tags - **RelatedContacts** - relationships to other contacts - **Documents** - associated documents - **Signatures/Initials** - digital signature images - **Representative** - representative contact info - **Language** - language preference ### Ad Hoc Fields (Permission-Filtered) Custom fields are filtered by the current user's roles: - Fields the user doesn't have **ViewRole** permission for are stripped from the response - List items' ad hoc fields are also filtered by permissions - **API users bypass all view/edit restrictions** - they see everything ### Lists Contact lists with items, where each item can have its own ad hoc fields (also permission-filtered). ## Script Example ```javascript async () => { const contact = await SecureApi.GetContactByID(5001); return { id: contact.ID, name: contact.Name, isPerson: contact.IsPerson, email: contact.Emails?.find(e => e.IsPrimary)?.Email, phone: contact.Phones?.find(p => p.IsPrimary)?.Phone, address: contact.Addresses?.find(a => a.IsPrimary), adHocFieldCount: contact.AdHocFields?.length ?? 0, documentCount: contact.Documents?.length ?? 0 }; } ``` ## Cross-References | Need | Use Instead | |------|-------------| | Search by name | `SearchContactsByContactNameAndAKA(Filter)` | | Search by phone | `SearchContactsByContactPhoneNumber(Filter)` | | Search by email | `SearchContactsByContactEmail(Filter)` | | Claim's contacts | `GetClaimContacts(ClaimID)` or `GetClaimContactList(ClaimID)` | ## Error Conditions - Not logged in - throws RadoloException - No company selected - throws RadoloException - Not member of company - throws RadoloException - ContactID < 0 - throws RadoloException - Contact belongs to different firm - throws RadoloException