BlogIntegrations · November 10, 2026 · 4 min read

Contact Form 7 CRM Lookups: Handle ETags and 304 Without Clearing Your Mapping

Use conditional GET for CRM reference lists when the API supports it. Keep the last valid mapping on 304 and separate outages from empty results.

A Contact Form 7 connector may fetch an approved list of CRM service codes, teams or active routing destinations before it sends leads. If the endpoint supports conditional reads, a refresh can return 304 Not Modified with no response body. Treating that body as an empty list can disable every route at once. The safe interpretation is to reuse the matching stored representation, subject to the endpoint’s cache rules and your routing policy.

A verification token travels between a server and a drawer holding reference cards.
Generated conceptual illustration; not a product screenshot or measured result.

Confirm which resource supports conditional reads

Check the exact CRM API version and read endpoint. This pattern assumes a GET that can return an ETag and honors If-None-Match. It is not a claim that every CRM list endpoint implements it. Use an approved read endpoint or a reference catalog that your team controls. Keep this fetch separate from the contact creation request and from your event handler. The request used to refresh a list should not block a form response indefinitely.

A read validator applies to the selected representation. Scope the stored entry to the provider, tenant, endpoint and relevant request variants, including locale, list filters or representation headers when applicable. If the caller’s authorization changes which entries are visible, keep those scopes separate too. Follow the response’s cache directives, including no-store. An ETag says nothing about whether you are allowed to share the underlying list. Avoid caching credentials or logging opaque headers and payloads when a status and reference timestamp are enough.

Store a usable snapshot and its validator together

Begin with a normal GET. In a synthetic staging catalog, imagine the response contains codes for repairs and installations and returns ETag: "service-catalog-7". Validate the response against your expected schema, including uniqueness of machine values and the fields that mark an entry active. Store the validated rows and the exact validator together. Save when the body was received and when the resource was last successfully validated. Update the entry atomically so a new ETag can never point to an older body after a crash.

On the next refresh, send If-None-Match: "service-catalog-7" for the same representation. Keep quotes and any weak-validator prefix from the original value. Do not try to increment the tag or use it as a database version. For paginated lists, an individual page validator only validates that response. It cannot prove that other pages are unchanged or that a moving collection is internally consistent. Use the provider’s documented full-snapshot or paging contract and consult the pagination reconciliation guide before replacing a complete catalog.

Make each refresh outcome explicit

  • 200 with a valid representation: Replace the scoped entry after validation. An explicitly empty array is a real candidate snapshot; handle it according to documented endpoint behavior and your rules for removing routes. It must pass the same validation as a nonempty list.
  • 304 with a matching stored body: Retain those rows, update validation time and apply applicable cache metadata from the response. Do not parse a JSON body from 304 or mark the source as empty.
  • 304 without a usable matching body: The response cannot reconstruct the list. Drop the orphan validator and attempt one unconditional fetch if the provider contract allows. If you still lack usable data, stop automatic routing and record the failure.
  • Invalid 200, timeout or 5xx: Keep the prior validated snapshot intact. Serve from it only within an explicit allowed staleness window and where the endpoint and business policy permit. Otherwise hold the lead for review.
  • 401 or 403: Treat this as an authorization problem. Do not use stale data to preserve access after permission may have been withdrawn. Stop that refresh path and surface the issue to the operator.

When two refresh workers can run at once, serialize updates per catalog key or compare a stored revision before committing. Otherwise a late response can replace newer rows. Track refresh outcomes separately from delivery outcomes. A healthy 304 does not say whether any submitted lead was routed successfully.

Test the first read, reuse and missing-body recovery

Use a stub with a small synthetic list. First return a valid 200 and validator; then return an empty-body 304 and confirm the same option still resolves. Send a valid changed 200 with a retired option and verify that a queued lead using the old code follows the agreed review rule. Try an invalid body, a timeout beyond the staleness ceiling, a permission failure and a restart that leaves a validator without rows. Add a second tenant with the same path and different labels to show that no cached mapping crosses scopes.

In the handoff log, keep the synthetic lead reference, catalog revision or validation timestamp, chosen route and decision category. That evidence helps you distinguish an obsolete option from a refresh outage without exposing the entire catalog. See the CRM option mapping guide for the separate question of renamed and retired values.

Use the free Svetlik Analytics for Contact Form 7 listing for a WordPress-side measurement starting point. This site publishes the plugin. Implement conditional lookups in the connector and keep catalog health separate from submission and delivery reporting.

Official references