{"_id":"55494b05f452670d00ec0c29","parentDoc":null,"user":"55208129504fd6230022ae20","editedParams":true,"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"},"__v":8,"githubsync":"","editedParams2":true,"category":{"_id":"55494a226a82a10d00817ae5","project":"55208137623ff50d009b2bec","version":"55208137623ff50d009b2bef","__v":15,"pages":["55494ad0ee219b0d001743bb","55494b05f452670d00ec0c29","55494b11ee219b0d001743bf","55494b20ee219b0d001743c1","55494b2bee219b0d001743c3","55494b4a6a82a10d00817af5","55494b686a82a10d00817af9","5549651ccd09b317005f8f50","55497273cd09b317005f8f86","554977f0c634cf2d001250a7","55b970eab42b610d00c9b2e3","5696f3688560a60d00e2c216","5696f91c59a6692d003fad50","5696f92c24490c3700170a2d","5696f9700b09a41900b24422"],"sync":{"url":"","isSync":false},"reference":true,"createdAt":"2015-05-05T22:54:26.925Z","from_sync":false,"order":2,"slug":"public-api","title":"Public API"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-05-05T22:58:13.015Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[{"status":200,"language":"json","code":"{\n\"to\":\"+13105551234\",\n\"text\":\"Hello\",\n\"tag_names\":[\"attribution\"],\n\"image_url\":\"http://images_website.com/some_url.png\",\n\"status\":\"queued\"\n}","name":""},{"status":400,"language":"json","code":"{\"error\":\"Tag with supplied name cannot be found, message not sent.\"}","name":""}]},"settings":"","examples":{"codes":[{"code":"curl 'https://www.sendsonar.com/api/v1/messages' \\\n  -X POST \\\n  -H 'X-Token:XXXXXXXXXXXXXXXXXXXXXXXX' \\\n  -H \"Content-Type: application/json\" \\\n  -d '{\"to\": \"+13105551234\", \"text\": \"Hey there, how did you hear about us?\", \"tag_names\":[\"attribution\"], \"media_url\": \"http://images_website.com/some_url.png\"}'","language":"curl","name":""}]},"method":"post","auth":"required","params":[{"_id":"554971fdcd09b317005f8f85","ref":"","in":"body","required":true,"desc":"The phone number of the person to whom you want to send an SMS.","default":"+13105551234","type":"string","name":"to"},{"_id":"554971fdcd09b317005f8f84","ref":"","in":"body","required":true,"desc":"The text of the SMS you want to send.","default":"","type":"string","name":"text"},{"_id":"55b97214b42b610d00c9b2ea","ref":"","in":"body","required":false,"desc":"Url of image that you'd like to send as an MMS message OR VCF file you'd like to send along with the message","default":"http://images_website.com/some_url.png OR http://vcf_website.com/some_url.vcf","type":"string","name":"media_url"},{"_id":"59933c0db1169f000f661fe5","ref":"","in":"body","required":false,"desc":"List of tags you'd like to append to the message. All tags listed must already exist otherwise the message will not send.","default":"","type":"array_string","name":"tag_names"}],"url":"/messages"},"isReference":true,"order":3,"body":"In the response, \"status\" will either be \"queued\" or \"unsubscribed\". A \"queued\" status is a successful response, and means that the message should be sent within seconds. An \"unsubscribed\" status means that the message will not be sent, as the customer has previously unsubscribed from messages from your business.\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Country Codes\",\n  \"body\": \"Please always include a country code (such as +1 for US) in all API calls to us.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Notes\",\n  \"body\": \"We prevent multiple identical messages from being sent to a single customer within 7 seconds to preserve the great SMS experience.\\n\\nIf you send a message to a new phone number the API will automatically create a new user.\"\n}\n[/block]","excerpt":"","slug":"send-message","type":"endpoint","title":"Send Message"}

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

to:
required
string+13105551234
The phone number of the person to whom you want to send an SMS.
text:
required
string
The text of the SMS you want to send.
media_url:
stringhttp://images_website.com/some_url.png OR http://vcf_website.com/some_url.vcf
Url of image that you'd like to send as an MMS message OR VCF file you'd like to send along with the message
tag_names:
array of strings
List of tags you'd like to append to the message. All tags listed must already exist otherwise the message will not send.

Examples


Result Format


Documentation

In the response, "status" will either be "queued" or "unsubscribed". A "queued" status is a successful response, and means that the message should be sent within seconds. An "unsubscribed" status means that the message will not be sent, as the customer has previously unsubscribed from messages from your business. [block:callout] { "type": "info", "title": "Country Codes", "body": "Please always include a country code (such as +1 for US) in all API calls to us." } [/block] [block:callout] { "type": "warning", "title": "Notes", "body": "We prevent multiple identical messages from being sent to a single customer within 7 seconds to preserve the great SMS experience.\n\nIf you send a message to a new phone number the API will automatically create a new user." } [/block]