{"metadata":{"image":[],"title":"","description":""},"api":{"url":"","auth":"required","settings":"","params":[],"results":{"codes":[]}},"next":{"description":"","pages":[]},"title":"Forwarding (DEPRECATED)","type":"basic","slug":"forwarding","excerpt":"Forward Messages","body":"To enable message forwarding over HTTP, update your Meshblu device to contain the following properties:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  meshblu: {\\n    forwarders: {\\n\\t\\t\\tsent:     [\\n        {\\n      \\t\\ttype: \\\"webhook\\\",\\n          url: \\\"http://requestb.in/18gkt511\\\",\\n          method: \\\"POST\\\"\\n        }\\n    \\t]\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\nCurrently there are four types of messages that can be forwarded: `broadcast`, `config`, `received`, `sent`.\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Forward Meshblu Credentials\"\n}\n[/block]\nGenerate a one-time Meshblu token and send it to the webhook. Sent as an HTTP header `Authorization: Bearer <base64 encoded string>`. The token will only be valid until the recipient of the Webhook responds to the HTTP request.\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Security Warning\",\n  \"body\": \"The `Bearer` token will allow the recipient to access and modify your meshblu device. When the request has finished, the token will be removed.\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  meshblu: {\\n    forwarders: {\\n\\t\\t\\tsent:     [\\n        {\\n      \\t\\ttype: \\\"webhook\\\",\\n          url: \\\"http://requestb.in/18gkt511\\\",\\n          method: \\\"POST\\\",\\n          generateAndForwardMeshbluCredentials: true\\n        }\\n    \\t]\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Signed Requests\"\n}\n[/block]\nTo ensure that you are receiving an authorized webhook, you may use the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md). You can verify the request without contacting Meshblu to verify it's authenticity.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  meshblu: {\\n    forwarders: {\\n\\t\\t\\tsent:     [\\n        {\\n      \\t\\ttype: \\\"webhook\\\",\\n          url: \\\"http://requestb.in/18gkt511\\\",\\n          method: \\\"POST\\\",\\n          signRequest: true\\n        }\\n    \\t]\\n    }\\n  }\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]","updates":[],"order":5,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"558dc2d7beb7c719007f63ca","parentDoc":null,"__v":12,"githubsync":"","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Message Forwarders","slug":"forwarding","order":4,"from_sync":false,"reference":false,"_id":"573b93514e029d19000b8669","project":"5564f26a1fd04c0d00dc9aaa","createdAt":"2016-05-17T21:55:29.422Z","version":"5564f26a1fd04c0d00dc9aad","__v":0},"user":"5564f227f0f70f0d00a9ab20","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["5564f26b1fd04c0d00dc9aae","556741d17acd550d0075eaca","556741d87acd550d0075eacb","556742f87acd550d0075ead1","556781cd6976ef0d0099c545","5568d666d33aad0d00ec8d2e","557f6b2d38249b0d00d0d12b","55b67be9c2e909190073ed38","564e56c601e80e0d00396684","56731b714b2a680d00524daf","573612ac652bd80e00a90027","57365e2cf8ebd31700769f50","57366131f8ebd31700769f58","573b93514e029d19000b8669","573bbfdb7ac6f6170033bd35"],"_id":"5564f26a1fd04c0d00dc9aad","createdAt":"2015-05-26T22:23:38.671Z","project":"5564f26a1fd04c0d00dc9aaa","releaseDate":"2015-05-26T22:23:38.671Z","__v":15},"project":"5564f26a1fd04c0d00dc9aaa","createdAt":"2015-06-26T21:23:35.225Z"}

Forwarding (DEPRECATED)

Forward Messages

To enable message forwarding over HTTP, update your Meshblu device to contain the following properties: [block:code] { "codes": [ { "code": "{\n meshblu: {\n forwarders: {\n\t\t\tsent: [\n {\n \t\ttype: \"webhook\",\n url: \"http://requestb.in/18gkt511\",\n method: \"POST\"\n }\n \t]\n }\n }\n}", "language": "json" } ] } [/block] Currently there are four types of messages that can be forwarded: `broadcast`, `config`, `received`, `sent`. [block:api-header] { "type": "basic", "title": "Forward Meshblu Credentials" } [/block] Generate a one-time Meshblu token and send it to the webhook. Sent as an HTTP header `Authorization: Bearer <base64 encoded string>`. The token will only be valid until the recipient of the Webhook responds to the HTTP request. [block:callout] { "type": "danger", "title": "Security Warning", "body": "The `Bearer` token will allow the recipient to access and modify your meshblu device. When the request has finished, the token will be removed." } [/block] [block:code] { "codes": [ { "code": "{\n meshblu: {\n forwarders: {\n\t\t\tsent: [\n {\n \t\ttype: \"webhook\",\n url: \"http://requestb.in/18gkt511\",\n method: \"POST\",\n generateAndForwardMeshbluCredentials: true\n }\n \t]\n }\n }\n}", "language": "json" } ] } [/block] [block:api-header] { "type": "basic", "title": "Signed Requests" } [/block] To ensure that you are receiving an authorized webhook, you may use the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md). You can verify the request without contacting Meshblu to verify it's authenticity. [block:code] { "codes": [ { "code": "{\n meshblu: {\n forwarders: {\n\t\t\tsent: [\n {\n \t\ttype: \"webhook\",\n url: \"http://requestb.in/18gkt511\",\n method: \"POST\",\n signRequest: true\n }\n \t]\n }\n }\n}", "language": "json" } ] } [/block]