{"result":{"depiction_url":null,"edges":{"in_module":{"objects":[{"created":"2020-07-13T14:05:16Z","object_id":{"id":1296,"is_a":["text","documentation","reference","module"],"name":"doc_module_mod_base","title":"mod_base","uri":"https:\/\/zotonic.com\/id\/1296"},"seq":1000000}],"predicate":{"id":333,"is_a":["meta","predicate"],"name":"in_module","title":{"_type":"trans","tr":{"en":"In module"}},"uri":"https:\/\/zotonic.com\/id\/in_module"}},"references":{"objects":[{"created":"2020-07-13T14:05:16Z","object_id":{"id":1892,"is_a":["text","documentation","reference","controller"],"name":"doc_controller_controller_mqtt_transport","title":"controller_mqtt_transport","uri":"https:\/\/zotonic.com\/id\/1892"},"seq":1000000}],"predicate":{"id":332,"is_a":["meta","predicate"],"name":"references","title":{"_type":"trans","tr":{"en":"References"}},"uri":"https:\/\/zotonic.com\/id\/references"}},"refers":{"objects":[{"created":"2026-09-09T13:48:13Z","object_id":{"id":1892,"is_a":["text","documentation","reference","controller"],"name":"doc_controller_controller_mqtt_transport","title":"controller_mqtt_transport","uri":"https:\/\/zotonic.com\/id\/1892"},"seq":1000000}],"predicate":{"id":2409,"is_a":["meta","predicate"],"name":"refers","title":{"_type":"trans","tr":{"en":"Refers"}},"uri":"https:\/\/zotonic.com\/id\/refers"}},"subject":{"objects":[{"created":"2026-09-09T13:48:13Z","object_id":{"id":2555,"is_a":["categorization","keyword","keyword_information_type"],"name":"zotonic_topic_reference","title":"Reference","uri":"https:\/\/zotonic.com\/id\/2555"},"seq":1},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2564,"is_a":["categorization","keyword","keyword_audience"],"name":"zotonic_topic_backend_developer","title":"Backend developer","uri":"https:\/\/zotonic.com\/id\/2564"},"seq":2},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2598,"is_a":["categorization","keyword","keyword_domain"],"name":"zotonic_topic_messaging_and_pubsub","title":"Messaging and publish-subscribe","uri":"https:\/\/zotonic.com\/id\/2598"},"seq":3},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2625,"is_a":["categorization","keyword","keyword_architecture"],"name":"zotonic_topic_model","title":"Model","uri":"https:\/\/zotonic.com\/id\/2625"},"seq":4},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2676,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_http","title":"HTTP","uri":"https:\/\/zotonic.com\/id\/2676"},"seq":5},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2677,"is_a":["categorization","keyword","keyword_technology"],"name":"zotonic_topic_mqtt","title":"MQTT","uri":"https:\/\/zotonic.com\/id\/2677"},"seq":6},{"created":"2026-09-09T13:48:13Z","object_id":{"id":2685,"is_a":["categorization","keyword","keyword_quality"],"name":"zotonic_topic_security","title":"Security","uri":"https:\/\/zotonic.com\/id\/2685"},"seq":7}],"predicate":{"id":308,"is_a":["meta","predicate"],"name":"subject","title":{"_type":"trans","tr":{"en":"Keyword"}},"uri":"http:\/\/purl.org\/dc\/elements\/1.1\/subject"}}},"id":2181,"is_a":["text","documentation","reference","model"],"links":[{"rel":"self","target":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2181"},{"rel":"hub","target":"https:\/\/zotonic.com\/.zotonic\/websub"}],"medium":null,"medium_url":null,"name":"doc_model_model_mqtt_ticket","page_url":{"en":"https:\/\/zotonic.com\/docs\/2181\/mqtt_ticket","x-default":"https:\/\/zotonic.com\/docs\/2181\/mqtt_ticket"},"preview_url":null,"resource":{"version":3891,"pivot_location_lat":null,"title":"mqtt_ticket","is_authoritative":true,"body":"<p>A ticketing system for out of band MQTT posts via HTTP.<\/p>\n<p>The controller <a href=\"\/id\/doc_controller_controller_mqtt_transport\" class=\"doc-reference doc-reference-controller\"><code>controller#controller_mqtt_transport<\/code><\/a> can accept HTTP posts.\nThese posts MUST include a ticket and a topic for the payload to be sent.<\/p>\n<p>The ticket is obtained via <code>model\/mqtt_ticket\/post\/new<\/code>. This can only be accessed via MQTT, as the routines will check\nfor a valid <code>client_id<\/code>.<\/p>\n<p>If a ticket is created then the current request context is saved for max 30 seconds. If a request comes in then the\nticket is used to fetch the stored context and the following information is copied over from the stored context to the\nHTTP request context:<\/p>\n<ul><li>MQTT client-id<\/li><li>MQTT client-topic<\/li><li>MQTT routing-id<\/li><li>ACL user id<\/li><li>ACL auth_options<\/li><li>ACL read-only flag<\/li><li>Timezone<\/li><li>Language<\/li><\/ul>\n<p>A ticket can only be used once.<\/p>\n<h2>Available Model API Paths<\/h2>\n<table class=\"table\"><thead><tr><th>Method<\/th><th>Path pattern<\/th><th>Description<\/th><\/tr><\/thead><tbody><tr><td><code>post<\/code><\/td><td><code>\/new<\/code><\/td><td>Create a one-time MQTT transport ticket for the current MQTT client context and return the generated ticket id (binary). No further lookups.<\/td><\/tr><tr><td><code>delete<\/code><\/td><td><code>\/+ticket<\/code><\/td><td>Invalidate\/delete ticket <code>+ticket<\/code> and its stored context so it can no longer be exchanged. No further lookups.<\/td><\/tr><\/tbody><\/table>\n<p><code>\/+name<\/code> marks a variable path segment. A trailing <code>\/...<\/code> means extra path segments are accepted for further lookups.<\/p>","slug":"mqtt_ticket","is_protected":false,"visible_for":0,"tz":"UTC","language":["en"],"doc_source_hash":"67b994ac4fc0698af99f0c3d626b76c994ac2cd91336d3f57a59ae3518f60748","is_featured":false,"content_group_id":{"id":2551,"is_a":["meta","content_group"],"name":"content_group_imported_docs","title":"Imported documentation","uri":"https:\/\/zotonic.com\/id\/content_group_imported_docs"},"category_id":{"id":322,"is_a":["meta","category"],"name":"model","title":"Models","uri":"https:\/\/test.zotonic.com\/id\/322"},"doc_source_path":"apps\/zotonic_mod_base\/src\/models\/m_mqtt_ticket.erl","publication_start":"2023-06-24T08:17:43Z","github_url":"https:\/\/github.com\/zotonic\/zotonic\/blob\/master\/apps\/zotonic_mod_base\/src\/models\/m_mqtt_ticket.erl","pivot_location_lng":null,"doc_source_kind":"model","name":"doc_model_model_mqtt_ticket","is_unfindable":false,"is_published":true,"pivot_geocode":null,"created":"2020-07-13T14:05:16Z","uri":null,"doc_status":"current","is_dependent":false,"erlang_app":"zotonic_mod_base","publication_end":"9999-06-01T00:00:00Z","modifier_id":{"id":1,"is_a":["person"],"name":"administrator","title":"Site Administrator","uri":"https:\/\/zotonic.com\/id\/1"},"privacy":0,"doc_source_commit":"4519ff71e2a58f11f0306125449698f2a400da2d\n","erlang_module":"m_mqtt_ticket","creator_id":{"id":336,"is_a":["person","robot"],"name":"gitbot","title":"Git","uri":"https:\/\/zotonic.com\/id\/336"},"modified":"2026-10-15T14:02:22Z","title_slug":"mqtt_ticket"},"uri":"https:\/\/zotonic.com\/id\/2181","uri_template":"https:\/\/zotonic.com\/id\/:id","websub":{"hub":"https:\/\/zotonic.com\/.zotonic\/websub","topic":"https:\/\/zotonic.com\/.zotonic\/websub\/topic\/2181"}},"status":"ok"}