{"_id":"56ead8d02aac471700fb1a6d","project":"55208137623ff50d009b2bec","version":{"_id":"55208137623ff50d009b2bef","__v":14,"project":"55208137623ff50d009b2bec","createdAt":"2015-04-05T00:26:31.564Z","releaseDate":"2015-04-05T00:26:31.563Z","categories":["55208138623ff50d009b2bf0","55494a226a82a10d00817ae5","55494ba7ee219b0d001743c8","55494bc1ee219b0d001743cc","56ead8c1df765617008bccaf","573a2073dd007d1700cf288f","579695b1f64c9f0e007cd76c","57969e3dfa1ff60e006a1274","579a4592fd9f3c0e008e4f4a","57ab9afe54fa780e006c5430","57b784f5b7ebd60e009cb4a6","58f686818193090f008cec76","59e79fbd4cf31900341d50c6","5b2436973fd93f0003dcf99d"],"is_deprecated":false,"is_hidden":false,"is_beta":true,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"editedParams2":true,"parentDoc":null,"user":"55208129504fd6230022ae20","category":{"_id":"56ead8c1df765617008bccaf","__v":6,"pages":["56ead8d02aac471700fb1a6d","56eadcacd25d831700006ab2","56eadf90d25d831700006aba","56eae54988fd9d290012c898","56eae7f3c760370e0037ab20","56eaef34df765617008bccc5"],"project":"55208137623ff50d009b2bec","version":"55208137623ff50d009b2bef","sync":{"url":"","isSync":false},"reference":true,"createdAt":"2016-03-17T16:18:09.231Z","from_sync":false,"order":5,"slug":"facebook-messenger","title":"Facebook Messenger"},"__v":5,"editedParams":true,"githubsync":"","updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-03-17T16:18:24.905Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":" -X POST \\\n -H 'X-Token:XXXXXXXXXXXXXXXXXXXXXXXX' \\\n -H \"Content-Type: application/json\" \\\n -d '{\"email\": \"1234:::at:::facebook.sendsonar.com\", \"type\": \"FBMessage\", \"text\": \"Hello\"}'","language":"curl"}]},"method":"post","results":{"codes":[{"name":"","code":"{\n\"to\":\"1234@facebook.sendsonar.com\",\n\"text\":\"Hello\",\n\"status\":\"queued\"\n}","language":"json","status":200}]},"settings":"","auth":"required","params":[{"_id":"56fd9a9faa7b710e007d37ed","ref":"","in":"body","required":false,"desc":"Use instead of \"TO\" if you want to find user by EMAIL","default":"","type":"string","name":"email"},{"_id":"56ead990eed93a0e00dd5016","ref":"","in":"body","required":true,"desc":"Email address OR Facebook commerce token for the customer. You will get this from Sonar's Get Customer endpoint or through the webhooks we send you when a customer opts-in to retail features or messages your business.","default":"","type":"string","name":"to"},{"_id":"56eadb1f199f7317006eb4d7","ref":"","in":"body","required":true,"desc":"The content of your message.","default":"","type":"string","name":"text"},{"_id":"56eadb1f199f7317006eb4d6","ref":"","in":"body","required":true,"desc":"Use \"FBMessage\" as the type, otherwise we default to sending an SMS.","default":"","type":"string","name":"type"},{"_id":"56eadb1f199f7317006eb4d5","ref":"","in":"body","required":false,"desc":"You can pass in most types of media to Facebook Messenger.","default":"","type":"string","name":"media_url"}],"url":"/messages"},"isReference":true,"order":1,"body":"Sending Facebook messages is just like sending SMS messages with Sonar, with a couple minor differences.","excerpt":"","slug":"messaging-api","type":"endpoint","title":"Send Facebook Message"}

postSend Facebook Message


Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

email:
string
Use instead of "TO" if you want to find user by EMAIL
to:
required
string
Email address OR Facebook commerce token for the customer. You will get this from Sonar's Get Customer endpoint or through the webhooks we send you when a customer opts-in to retail features or messages your business.
text:
required
string
The content of your message.
type:
required
string
Use "FBMessage" as the type, otherwise we default to sending an SMS.
media_url:
string
You can pass in most types of media to Facebook Messenger.

Examples


Result Format


Documentation

Sending Facebook messages is just like sending SMS messages with Sonar, with a couple minor differences.