Gamification 0.9.97 / Developers
REST, PHP APIs, and hooks
Integrate safely with the Gamification domain boundary.
REST namespace: /wp-json/cointacted-gamification/v1.
Free routes include point types, /me/balances, /me/summary, /me/ledger, /me/views/{view}, /me/privacy, /surfaces, privacy-filtered /profiles/{username}, transaction mutations, and canonical events. Ledger/history items expose both the stored exact amount and an exact-decimal formatted display value. The overview member view applies the configured point-type allow-list and section toggles, including private owner activity when enabled. Pro definitions and earned records remain readable after expiry; Pro definition/mutation permissions additionally require an active entitlement. See route discovery in WordPress for exact methods and argument schemas.
The optional Social Terminal integration registers only native Cointacted Gamification commands and resolves them through the same member presenter, achievement, leaderboard, and ledger services. Provider adapters do not register commands and cannot become command execution backends.
Core PHP helpers are cointacted_gamification_award(), cointacted_gamification_deduct(), cointacted_gamification_transfer(), cointacted_gamification_reverse(), and cointacted_gamification_record_event(). Pro helpers cover achievement grants/revocation/progress and rank assignment. cointacted_gamification_project_leaderboards() returns a provider-neutral, read-only projection for host surfaces; its arguments support an include identifier list, a bounded limit, and a diagnostic surface name. Pass exact decimal strings and stable idempotency keys to mutation helpers.
Important extension hooks include cointacted_gamification_loaded, cointacted_gamification_event_received, cointacted_gamification_transaction_posted, cointacted_gamification_achievement_revoked, cointacted_gamification_adapter_error, cointacted_gamification_integration_catalog, and the read-only cointacted_gamification_leaderboard_projection filter.
Native applications consume Cointacted_Gamification_Member_Presenter::surface_descriptors() or GET /surfaces; the cointacted_gamification_surface_descriptors filter can add portable host metadata. Installed presentation adapters register their administrator-facing paths through cointacted_gamification_display_references. A route entry contains host, label, path, and enabled. This is the extension boundary intended for SnapWeb, FluentCommunity, and future SnapCommunity adapters; adapters own routing and layout while Gamification continues to own data, privacy, exact balances, and rendering contracts.
Provider content and surface navigation
Community adapters use cointacted_gamification_capture_content_reference to convert a canonical event subject into Cointacted_Gamification_Content_Reference::provider( $provider, $object_type, $object_id, $context ). The immutable identity is the provider, its native object type, and a stable opaque identifier. A URL in the context is only a historical compatibility snapshot and is never the canonical identity.
At presentation time, the owning adapter resolves that reference through cointacted_gamification_resolve_content_reference. The adapter must apply the current viewer's native access policy and return available, restricted, or unavailable; only an available result may include a current absolute HTTP(S) URL. Gamification never guesses a provider route or falls back around the adapter's privacy decision.
The Display → Content and privacy settings control whether related content appears, whether restricted or unavailable states remain visible, and whether available links open in the current application or a new tab. These are provider-neutral presentation choices. Administrators never configure community URL paths in Gamification; the owning adapter rebuilds the current native route after access is granted.
Dynamically rendered related-content anchors carry data-cointacted-content-link="1" plus provider and object-type metadata when available. Ordinary WordPress follows the anchor normally. SnapWeb and community SPA adapters may give that same current URL to their native router. Content ownership and navigation ownership therefore remain independent.
