{"_id":"5792abdf366dd20e004736cc","user":"5564f227f0f70f0d00a9ab20","category":{"_id":"573f3f6c87cbd20e00208e44","project":"573f3f6c87cbd20e00208e41","version":"573f3f6c87cbd20e00208e42","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-05-19T16:56:14.991Z","from_sync":false,"order":0,"slug":"the-octoblu-platform","title":"Octoblu APIs"},"version":{"_id":"573f3f6c87cbd20e00208e42","__v":2,"project":"573f3f6c87cbd20e00208e41","createdAt":"2016-05-18T20:59:16.635Z","releaseDate":"2016-05-18T20:59:16.635Z","categories":["573f3f6c87cbd20e00208e44","573f3f6c87cbd20e00208e43","573f3f6c87cbd20e00208e45","573f3f6c87cbd20e00208e46","573f3f6c87cbd20e00208e47","573f3f6c87cbd20e00208e48","573f3f6c87cbd20e00208e49","573f3f6c87cbd20e00208e4a","573f3f6c87cbd20e00208e4b","579a382265f89a170099946f","57bce03036eff81700666963"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":0,"project":"573f3f6c87cbd20e00208e41","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-07-22T23:27:27.396Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":999,"body":"Octoblu will look for a specific key in your message in order to send a message directly to a flow.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Send Message\"\n}\n[/block]\n`metadata.to` must contain `flowId` and `nodeId` in order to directly message a node in the flow.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"metadata\\\": {\\n    \\\"to\\\": {\\n      \\\"flowId\\\": \\\"the-flow-id\\\",\\n      \\\"nodeId\\\": \\\"the-node-id\\\"\\n    }\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"meshblu message\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Replying Directly to a Node\"\n}\n[/block]\nYour device can reply directly to a particular node in the designer. If your device has a schema that supports `metadata.respondTo`, Octoblu will automatically populate it with the information needed to directly reply to the node. Take all the properties listed in `metadata.respondTo` and place it in the `metadata.to` of your response message.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"schemas\\\": {\\n    \\\"version\\\": \\\"2.0.0\\\",\\n    \\\"message\\\": {\\n      \\\"SomeAction\\\": {\\n        \\\"title\\\": \\\"Some Action\\\",\\n        \\\"type\\\": \\\"object\\\",\\n      \\t\\\"properties\\\": {\\n          \\\"metadata\\\": {\\n            \\\"type\\\": \\\"object\\\",\\n            \\\"properties\\\": {\\n              \\\"respondTo\\\": {\\n              }\\n            }\\n          }\\n        },\\n        \\\"required\\\": [\\n          \\\"metadata\\\"\\n        ]\\n      }\\n    }\\n  }\\n}\",\n      \"language\": \"json\",\n      \"name\": \"schema example\"\n    }\n  ]\n}\n[/block]","excerpt":"How to send a message directly to a node in the flow","slug":"direct-message-a-node","type":"basic","title":"Direct Message a Node"}

Direct Message a Node

How to send a message directly to a node in the flow

Octoblu will look for a specific key in your message in order to send a message directly to a flow. [block:api-header] { "type": "basic", "title": "Send Message" } [/block] `metadata.to` must contain `flowId` and `nodeId` in order to directly message a node in the flow. [block:code] { "codes": [ { "code": "{\n \"metadata\": {\n \"to\": {\n \"flowId\": \"the-flow-id\",\n \"nodeId\": \"the-node-id\"\n }\n }\n}", "language": "json", "name": "meshblu message" } ] } [/block] [block:api-header] { "type": "basic", "title": "Replying Directly to a Node" } [/block] Your device can reply directly to a particular node in the designer. If your device has a schema that supports `metadata.respondTo`, Octoblu will automatically populate it with the information needed to directly reply to the node. Take all the properties listed in `metadata.respondTo` and place it in the `metadata.to` of your response message. [block:code] { "codes": [ { "code": "{\n \"schemas\": {\n \"version\": \"2.0.0\",\n \"message\": {\n \"SomeAction\": {\n \"title\": \"Some Action\",\n \"type\": \"object\",\n \t\"properties\": {\n \"metadata\": {\n \"type\": \"object\",\n \"properties\": {\n \"respondTo\": {\n }\n }\n }\n },\n \"required\": [\n \"metadata\"\n ]\n }\n }\n }\n}", "language": "json", "name": "schema example" } ] } [/block]