Repository navigation
platform sdk visitors
In Security Center, a visitor is a temporary cardholder represented by a Visitor entity, which derives from Cardholder. The entity represents the visitor's current visit. After checkout, Security Center can retain an archived visit record according to the archived visitor retention configuration. Use Engine.VisitorManager to retrieve an archived visit and recreate a Visitor entity when the visitor returns:
VisitorManager manager = engine.VisitorManager;Use the report manager to query active and archived visitors. Retrieve an archived visitor as an ArchivedVisitor snapshot through VisitorManager.
Use VisitorQuery to search for active or archived visitors by state, name, contact information, or time range. Create the query through the report manager and execute it with BeginQuery/EndQuery:
VisitorQuery query = (VisitorQuery)engine.ReportManager
.CreateReportQuery(ReportType.Visitor);
query.VisitorStates.Add(VisitorState.Archived);
query.LastName = "Smith";
query.LastNameSearchMode = StringSearchMode.StartsWith;
query.MaximumResultCount = 50;
QueryCompletedEventArgs result = await Task.Factory.FromAsync(
query.BeginQuery,
query.EndQuery,
null);
foreach (DataRow row in result.Data.Rows)
{
Guid visitorGuid = row.Field<Guid>("Guid");
VisitorState state = row.Field<VisitorState>("VisitorState");
Console.WriteLine($"{visitorGuid}: {state}");
}VisitorQuery.VisitorStates is empty by default, which queries both active and archived visitors. Add VisitorState.Active or VisitorState.Archived to restrict the results to one state.
Note
VisitorQuery is not supported by ReportManager.QueryAsync. Use BeginQuery/EndQuery as shown above, or use the synchronous Query() method.
Filter properties on VisitorQuery:
- Name filters:
FirstName,LastName,FullName, each paired with a matching*SearchModeofStringSearchMode. - Contact filters:
Email,MobilePhoneNumber, also paired with*SearchMode. - Time-range filters:
ActivationTimeRange,ArrivalTimeRange,DepartureTimeRange,ExpirationTimeRange. Mutate each through itsSetTimeRangemethods. -
EntityGuidsto restrict the result to specific visitor identifiers. -
CustomFieldsto filter by visitor custom field values. -
LastConfiguration, which defaults totrue, to return only the latest archived configuration and omit archived configurations for current visitor entities. Set it tofalseto include earlier archived configurations. -
MaximumResultCountto cap the result set.
The result table includes these columns, in order:
GuidFirstNameLastNameEmailCustomFieldsActivationDateExpirationDatePictureThumbnailCheckinDateCheckoutDateDescriptionEscortEscort2MandatoryEscortVisitDateMobilePhoneNumberVisitorState
Active and archived visitor rows use the same 18-column result schema. A column can contain DBNull or a default value when the visitor has no value for that field. For an active row, Guid identifies the current Visitor entity. Retrieve it with engine.GetEntity<Visitor>(visitorGuid) when you need entity members or operations such as Checkout.
VisitorManager exposes two lookup methods that return an ArchivedVisitor snapshot:
ArchivedVisitor archived = engine.VisitorManager
.GetArchivedVisitor(visitorGuid);
ArchivedVisitor archivedByCardholder = engine.VisitorManager
.GetArchivedVisitorByCardholderId(cardholderGuid);Use GetArchivedVisitor with the Guid value from an archived VisitorQuery row. This identifier represents one archived visit. Use GetArchivedVisitorByCardholderId with the original Visitor entity identifier, which ArchivedVisitor.CardholderId exposes.
When you require a specific archived visit, query archived visitors and pass the row's Guid to GetArchivedVisitor. GetArchivedVisitor raises SdkException with SdkError.InvalidValue when no archived visit matches the identifier.
ArchivedVisitor is a snapshot of an archived visit. Guid and CardholderId are read-only. Before calling CreateVisitor, you can change the contact details, escort assignments, picture, and custom field values that the method copies. Changes to lifecycle properties on the snapshot do not affect the recreated visitor.
CreateVisitor creates a new Visitor entity from an ArchivedVisitor and uses ArchivedVisitor.CardholderId as the new entity's Guid:
ArchivedVisitor archived = engine.VisitorManager
.GetArchivedVisitor(visitorGuid);
Visitor recreated = engine.VisitorManager.CreateVisitor(archived);The following fields are copied from the archived visitor onto the new entity:
-
Name, used as the new entity's name -
FirstName,LastName,EmailAddress,Description, andMobilePhoneNumber -
EscortandEscort2 MandatoryEscortPicture- Archived values for visitor custom fields that still exist and contain a value
CreateVisitor does not copy ActivationDate, ExpirationDate, ExpirationMode, CheckinDate, CheckoutDate, VisitDate, or VisitState. Configure the new visit through supported Visitor members such as Arrival, Departure, and VisitDate. CheckinDate is read-only, and the archived checkout date and visit state remain historical information.
- About access control: Access control entities and their relationships.
- About cardholders and credentials: Cardholder, group, and credential configuration and lifecycle.
- Overview
- Connecting to Security Center
- SDK certificates
- Referencing SDK assemblies
- ASP.NET hosting
- SDK compatibility
- Migrating to modern .NET
- Entities
- Entity cache
- Entity loading, cache, and query options
- Detecting entity changes
- Entity change event reference
- Transactions
- Security Center events
- Actions
- Security Desk
- Custom events
- Event-to-actions
- Managing macros
- ReportManager
- ReportManager query reference
- Access control raw events
- DownloadAllRelatedData and StrictResults
- Privileges
- Partitions
- Entity write restrictions
- About custom fields
- About video
- About cameras
- Enrolling a video unit
- Ingesting third-party video
- Archiver and auxiliary archiver roles
- Archive transfer
- About access control
- About cardholders and credentials
- About doors, areas, elevators, and access points
- About access rules and schedules
- About access control units and interface modules
- Enrolling an access control unit
- Door templates
- Visitors
- Mobile credentials
- About threat levels
- About alarms
- About incidents
- Maps
- Logging
- Overview
- Localization
- Certificates
- Lifecycle
- Threading
- State management
- Configuration
- Restricted configuration
- Events
- Queries
- Request manager
- Database
- Entity ownership
- Engine extensions
- Entity mappings
- Server management
- Custom privileges
- Custom entity types
- Resolving non-SDK assemblies
- Deploying plugins
- Modern .NET support
- Overview
- Localization
- Certificates
- Creating modules
- Tasks
- Pages
- Components
- Tile extensions
- Services
- Contextual actions
- Custom actions
- Options extensions
- Configuration pages
- Monitors
- Shared components
- Commands
- Extending events
- Map extensions
- Timeline providers
- Image extractors
- Credential encoders
- Credential readers
- Cardholder fields extractors
- Badge printers
- Content builders
- Dashboard widgets
- Incidents
- Logon providers
- Pinnable content builders
- Custom report pages
- Overview
- Getting started
- Media file formats
- MediaPlayer
- VideoSourceFilter
- MediaExporter
- MediaFile
- G64 converters
- FileCryptingManager
- PlaybackSequenceQuerier
- PlaybackStreamReader
- OverlayFactory
- PtzCoordinatesManager
- AudioTransmitter
- AudioRecorder
- AnalogMonitorController
- Camera blocking
- Overview
- Getting started
- Referencing entities
- Entity operations
- About access control in the Web SDK
- About video in the Web SDK
- Users and user groups
- Partitions
- Custom fields
- Custom card formats
- Actions
- Events and alarms
- Incidents
- Reports
- Tasks
- Macros
- Custom entity types
- System endpoints
- Performance guide
- Reference
- Endpoints
- Constants
- Enumerations
- Under the hood
- Troubleshooting