Entrata Integration
Overview
This document outlines the integration flow between our platform and Entrata, a property management system. The integration allows us to receive property data from Entrata and handle tour scheduling.
Webhook Logging
-
Logging Process
- Every incoming webhook from Entrata is logged in the
entrata_webhookstable - The
logWebhook()function indb.phphandles this process - The following information is captured for each webhook:
- Request type (e.g., ACTIVATION, SUSPENDED, CHANGE_FEED_TYPE)
- Client ID (CID)
- Property ID
- Raw query string (complete URL parameters)
- This logging is essential for debugging and auditing purposes
- Every incoming webhook from Entrata is logged in the
-
Implementation Details
- The logging happens at the beginning of the webhook processing in
index.php - A unique log ID is generated for each webhook request
- If logging fails, the system continues processing but logs a warning
- The logging happens at the beginning of the webhook processing in
-
Benefits
- Provides a complete audit trail of all Entrata interactions
- Helps with troubleshooting integration issues
- Allows for analysis of webhook patterns and frequencies
- Enables correlation between webhook events and system responses
Authentication Flow
-
Initial Authentication
- Entrata sends a webhook to our platform with an authorisation code
- We validate the request and client credentials
- We exchange the authorisation code for an access token using Entrata’s OAuth endpoint
- The access token is stored in the
entrata_clientstable for future API calls
-
Client Setup
- When a new Entrata client is authenticated, we create for them:
- A agent user record in the
userstable - A property operator record in the
property_operatorstable - An Entrata client record in the
entrata_clientstable
- A agent user record in the
- These records are linked together to maintain the relationship between the client and their properties
- This is necessary as it allows their properties to also be managed through our Portal using the existing flow
- When a new Entrata client is authenticated, we create for them:
Property Activation Flow
-
Property Activation
- When a client using Entrata sends a property activation request:
- We send back an approval to Entrata
- We retrieve the relevant property data from Entrata
- We store the property data in the
housestable - The property is linked to the appropriate property operator and agent created earlier
- When a client using Entrata sends a property activation request:
-
Property Ingestion
- Property data includes:
- Basic information (address, bedrooms, bathrooms, etc.)
- Pricing information
- Images
- Property data includes:
Tour Scheduling Flow
-
User Initiates Tour Request
- User taps on an Entrata property in the app
- App calls
/api/getEntrataTourTimes.phpwith the property ID - Backend retrieves the property’s Entrata client information and access token
- Backend calls Entrata’s
getTourAvailability()service to fetch available tour slots for that property, converting them from whatever timezone they were sent in toAmerica/Chicago - Available tour times are returned to the app and displayed to the user
-
User Selects Tour Time
- User selects a preferred tour time slot from the available options
- App calls
/api/requestViewing.phpwith the selected time slot and user information - Backend creates a viewing request record in our
viewingstable - Backend calls
sendLeadToEntrataFromViewing()function to send the tour booking to Entrata - Entrata confirms the booking and returns a confirmation
- Note: Entrata requires time slots sent to them to be in the exact same format they were sent to us in (i.e.
10:00 MST - 10:30 MST). This is why both the raw and formatted tour dates are sent back to the app
-
Tour Confirmation
- User sees their new tour booking on the
Toursscreen - Property operator receives new tour request on their dashboard
- User sees their new tour booking on the
Database Structure
-
Key Tables
entrata_clients: Stores Entrata client information and access tokensproperty_operators: Links Entrata clients to property operatorshouses: Stores property data from Entratausers: Stores Entrata client agent informationentrata_webhooks: Stores logs of all incoming webhooks from Entrata
-
Relationships
- Entrata clients are linked to property operators
- Properties are linked to property operators and agents
- Tour and lead data are associated with specific properties
Error Handling
-
Validation
- Request validation ensures all required fields are present
- Data validation and formatting ensures data is sent as expected to Entrata
- Error responses include appropriate HTTP status codes and messages
-
Logging
- Extensive error logging is implemented throughout the integration
- Logs include request details, response data, and error messages
- This helps with debugging and troubleshooting integration issues
Security Considerations
-
Authentication
- OAuth tokens are used for API authentication
- Tokens are stored securely in the database
- Client credentials are validated on each request
Last updated on