Microsoft Dynamics 365 REST API
External Api Integration by Microsoft Corporation
Description
Microsoft Dynamics 365 is HLF's CRM and member portal platform. The integration synchronises peer mentor certification status and membership data between the mobile app and HLF's Dynamics-based 'Min Side' portal, ensuring that expired certifications automatically suppress mentor profiles from HLF's public website. This is a MUST HAVE integration for HLF's Phase 3 requirements and is the most complex external system dependency.
Detailed Analysis
Microsoft Dynamics 365 is HLF's existing CRM backbone and the most strategically critical external dependency in Phase 3. This bidirectional integration ensures that peer mentor certification status is automatically propagated to HLF's public-facing 'Min Side' portal, so expired certifications suppress mentor profiles without manual intervention. This protects HLF's brand and compliance posture by preventing unqualified mentors from appearing as active. Because the integration runs within HLF's existing Dynamics 365 subscription, there are no additional licensing costs — only developer effort for schema mapping and ongoing maintenance when HLF updates their Dynamics configuration.
The principal business risk is dependency on HLF IT to complete Azure AD application registration and provide Dynamics schema documentation, both prerequisites outside the development team's control. Data security is tightly scoped: credentials are server-side only, OAuth token rotation is enforced via Azure AD lifetime policies, and sync permissions are limited to certification read and sync metadata write — minimising exposure of HLF's member data.
This is the highest-complexity external dependency in the project and the one most likely to cause Phase 3 delivery delays. Four prerequisites must be satisfied by HLF IT before development can begin: Azure AD application registration, provision of Client ID, Client Secret, and Tenant ID, Dynamics 365 API permission grants, and schema documentation for HLF's Dynamics data model. None of these are within the development team's control, making early engagement with HLF IT essential. The integration involves eight components — including the DynamicsPortalClient, HLFDynamicsSyncService, IntegrationConfigDashboard, and IntegrationHealthMonitor — requiring coordinated development and integration testing.
Testing requires a live or sandbox Dynamics 365 environment, which must be arranged with HLF. Ongoing maintenance overhead is non-trivial: any change HLF makes to their Dynamics schema or Azure AD configuration can break the sync and requires developer intervention. Monitoring includes consecutive-failure alerts, certification mismatch detection, and authentication expiry warnings surfaced in the admin dashboard. A manual CSV export fallback is available as a contingency if the automated sync cannot be delivered on time.
The integration uses Microsoft Dynamics 365 Web API v9.2 with OAuth 2.0 client credentials flow authenticated against HLF's Azure Active Directory tenant. Required environment variables — DYNAMICS_TENANT_ID, DYNAMICS_CLIENT_ID, DYNAMICS_CLIENT_SECRET, and DYNAMICS_INSTANCE_URL — must be provisioned server-side only; credentials are never exposed to the mobile client. The sync pattern is delta-based using timestamp conflict detection to minimise API load against Dynamics' 6,000-requests-per-5-minutes rate limit. Failed sync events are logged and retried on the next scheduled run; certification sync failures trigger coordinator notifications.
The IntegrationHealthMonitor component surfaces connectivity state and last-successful-sync timestamps to the admin dashboard. Eight components depend on this integration, including the AccountingExporterService and IntegrationConfigService, requiring careful field-mapping configuration. Fallbacks include a manual CSV export path and local caching of certification status with a staleness indicator. OAuth tokens are automatically rotated via Azure AD token lifetime policies.
Nightly batch sync is the baseline; real-time is explicitly not required for most data, keeping rate limit pressure low.
Using Components (8)
Dependencies (4)
Authentication
| Type | Oauth |
| Requirements | Azure Active Directory application registration, Client ID, client secret, and tenant ID for HLF's Azure AD, Dynamics 365 API permission grants, Service account with appropriate Dynamics roles |
| Scopes | Dynamics CRM read/write for member entitiesExport posting permissions |
Configuration
DYNAMICS_TENANT_ID
DYNAMICS_CLIENT_ID
DYNAMICS_CLIENT_SECRET
DYNAMICS_INSTANCE_URL
Error Handling
Monitoring
Performance
| Latency | Nightly batch sync acceptable — real-time not required for most data |
| Availability | Daily sync minimum; certification status changes must propagate within 24 hours |
Cost Implications
| Pricing Model | Included in HLF's existing Dynamics 365 subscription |