controller_websub_topic

Serve the complete JSON representation advertised as a resource's WebSub topic.

The websub_topic dispatch is /.zotonic/websub/topic/:id and supports GET and HEAD. It offers only application/json, independently of the representations available through the semantic /id URI. The export uses the x-default language context, avoiding a language-dependent delivery topic.

Successful responses use the resource-export envelope:

{"status":"ok","result":{"uri":"https://example.com/id/123","resource":{}}}

The example abbreviates the result; m_rsc_export:full/2 supplies the complete export, including connections, media metadata, and discovery links. The resource's result.uri remains its language-less semantic identifier. The HTTP Link self points to this JSON topic, and the hub link identifies controller_websub.

Only authoritative local resources are served. Export access uses the current request's ACL context; an export error returns 403, while a missing or non-authoritative resource returns 404. Successful responses disable caching and include resource discovery headers. Private exports require authorized access.

m_websub uses the same full-export representation for delivery to verified subscribers, including non-Zotonic subscribers. See mod_websub for discovery, subscription, and the distinction between resource identity and delivery topic.

Edit on GitHub