{"_id":"5745e749a488e817005419cb","__v":4,"project":"573c99725c4c010e006caa54","user":"5564f227f0f70f0d00a9ab20","category":{"_id":"573c99725c4c010e006caa58","version":"573c99725c4c010e006caa57","__v":0,"project":"573c99725c4c010e006caa54","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-18T16:33:54.308Z","from_sync":false,"order":9999,"slug":"documentation","title":"Data Forwarders"},"version":{"_id":"573c99725c4c010e006caa57","project":"573c99725c4c010e006caa54","__v":3,"createdAt":"2016-05-18T16:33:54.264Z","releaseDate":"2016-05-18T16:33:54.264Z","categories":["573c99725c4c010e006caa58","5750c01651b4bb2b00178745","5751d0628e9ef90e0083eb06"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-25T17:56:25.419Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"Data forwarders provide the ability to forward messages and configuration events from Meshblu into any other service via a combination of [Subscriptions 2.0](https://meshblu.readme.io/docs/subscriptions-2-0) and [Forwarding 2.0 Webhooks](https://meshblu.readme.io/docs/forwarding-meshblu-2-0). Below is a brief description of how this works.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Setting Up the Data Forwarder\"\n}\n[/block]\n\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/nSep72jCTPiqsATstHDe_Data-forwarder.svg\",\n        \"Data-forwarder.svg\",\n        \"0\",\n        \"0\",\n        \"#323232\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nA data forwarder is simply a device that:\n\n1. [Subscribes](https://meshblu.readme.io/docs/subscriptions-2-0) to other devices (generally their message.received and broadcast.sent messages), and\n2. Has [forwarding](https://meshblu.readme.io/docs/forwarding-meshblu-2-0) configured, usually as a webhook, that points to a service that collects the data.\n3. Generally has some configuration information for the service in it's device data in Meshblu\n\n\nIn the above diagram the forwarder is subscribed to 2 devices: **Blink1** and **Endoskeleton**. When either of these two devices **receives** a message, the forwarder device will also receive it, and post the results to the forwarding webhook that points to the service.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"In order for a forwarder to subscribe to a device's received messages, it needs to be in the receiving device's **message.received** [whitelist](https://meshblu.readme.io/docs/whitelists-2-0)\\n\\nIn the above example, both the Blink1 and Endoskeleton devices need to have the forwarder in their message.received whitelist.\",\n  \"title\": \"Permissions\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Forwarding Messages\"\n}\n[/block]\nOnce the forwarder is set up, it will forward any messages received by the devices it is subscribed to.\n[block:image]\n{\n  \"images\": [\n    {\n      \"image\": [\n        \"https://files.readme.io/MsQR5wCYQ8SiIhOtO2YQ_data-forwarder-message.svg\",\n        \"data-forwarder-message.svg\",\n        \"0\",\n        \"0\",\n        \"#323232\",\n        \"\"\n      ]\n    }\n  ]\n}\n[/block]\nIn this example, the Doorbell device sends a message to the Endoskeleton device. Since the Forwarder device is subscribed to the Endoskeleton's received messages, it receives a copy of the message.\n\nFinally, the Forwarder's copy of the message is posted up to the service via the webhook.","excerpt":"Do you like flow charts? Because we made *two* for you.","slug":"getting-started","type":"basic","title":"How They Work"}

How They Work

Do you like flow charts? Because we made *two* for you.

Data forwarders provide the ability to forward messages and configuration events from Meshblu into any other service via a combination of [Subscriptions 2.0](https://meshblu.readme.io/docs/subscriptions-2-0) and [Forwarding 2.0 Webhooks](https://meshblu.readme.io/docs/forwarding-meshblu-2-0). Below is a brief description of how this works. [block:api-header] { "type": "basic", "title": "Setting Up the Data Forwarder" } [/block] [block:image] { "images": [ { "image": [ "https://files.readme.io/nSep72jCTPiqsATstHDe_Data-forwarder.svg", "Data-forwarder.svg", "0", "0", "#323232", "" ] } ] } [/block] A data forwarder is simply a device that: 1. [Subscribes](https://meshblu.readme.io/docs/subscriptions-2-0) to other devices (generally their message.received and broadcast.sent messages), and 2. Has [forwarding](https://meshblu.readme.io/docs/forwarding-meshblu-2-0) configured, usually as a webhook, that points to a service that collects the data. 3. Generally has some configuration information for the service in it's device data in Meshblu In the above diagram the forwarder is subscribed to 2 devices: **Blink1** and **Endoskeleton**. When either of these two devices **receives** a message, the forwarder device will also receive it, and post the results to the forwarding webhook that points to the service. [block:callout] { "type": "warning", "body": "In order for a forwarder to subscribe to a device's received messages, it needs to be in the receiving device's **message.received** [whitelist](https://meshblu.readme.io/docs/whitelists-2-0)\n\nIn the above example, both the Blink1 and Endoskeleton devices need to have the forwarder in their message.received whitelist.", "title": "Permissions" } [/block] [block:api-header] { "type": "basic", "title": "Forwarding Messages" } [/block] Once the forwarder is set up, it will forward any messages received by the devices it is subscribed to. [block:image] { "images": [ { "image": [ "https://files.readme.io/MsQR5wCYQ8SiIhOtO2YQ_data-forwarder-message.svg", "data-forwarder-message.svg", "0", "0", "#323232", "" ] } ] } [/block] In this example, the Doorbell device sends a message to the Endoskeleton device. Since the Forwarder device is subscribed to the Endoskeleton's received messages, it receives a copy of the message. Finally, the Forwarder's copy of the message is posted up to the service via the webhook.