{"__v":9,"_id":"544f8fd2cf9f8608008014e0","category":{"__v":21,"_id":"543bf3e22a30961a00b66eb3","pages":["5489d5e61ea5330b007b5a51","5489e243d8dec60b00034297","5489e318aefb240b00d197ef","56cdf622e538330b0021ab5a"],"project":"542dbe0ecb19820800c1f4d7","version":"542ecc0a6b0eb6080066ca77","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2014-10-13T15:46:42.097Z","from_sync":false,"order":1,"slug":"inboundxml","title":"InboundXML"},"is_link":false,"parentDoc":null,"project":"542dbe0ecb19820800c1f4d7","user":"544a586d27b7fc140078db12","version":{"__v":29,"_id":"542ecc0a6b0eb6080066ca77","forked_from":"542dbe0fcb19820800c1f4da","project":"542dbe0ecb19820800c1f4d7","createdAt":"2014-10-03T16:17:14.165Z","releaseDate":"2014-10-03T16:17:14.165Z","categories":["542ecc0a6b0eb6080066ca78","542ef44f6b0eb6080066cb24","543bf3e22a30961a00b66eb3","5446952b82bd7e08002768a0","544821ae8d7af31a00dd41ce","544a7885f1aefa08006efc69","544c758e11845f0e001ed8de","544e5565b80812080035be55","544e558dbd51b9080037f8ca","5450b045a66f020800dba73d","5450eb6aa66f020800dba945","5450f39ea66f020800dba989","5450f877a66f020800dba9cf","54510356a66f020800dbaa17","5451274514af501a00b50c99","54513345a66f020800dbab24","54513cc014af501a00b50d24","54515eec14af501a00b50db9","54519b1d14af501a00b50ea9","54519b2aa66f020800dbacb4","54524f9704160008005b1d27","54538d2308d1800800473d95","54538d420c09721000a06a03","54538e5608d1800800473d9a","5453ea9547c30114004fb375","5453eb12b077c31c00067bcb","5453eb27b077c31c00067bcd","5453ed5db077c31c00067bde","548075cbe291c51a00e7e096"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2014-10-28T12:45:06.228Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"basic_auth":false,"results":{"codes":[]},"settings":"","try":true,"auth":"never","params":[],"url":""},"isReference":false,"order":18,"body":"Zang allows SMS messages to be sent during a call using the `<Sms>` element. The SMS receiver (to attribute) must be a valid phone number. The sender (from attribute) must be one of your registered Zang numbers. The text of the message should be placed inside the element and can not be longer than 160 characters. \n\nThe action attribute can be used to direct the SMS to a new InboundXML document for processing. If directed to a new InboundXML using the action attribute, all InboundXML beneath the `<Sms>` element in the originating InboundXML document is disregarded. Similarly, the statusCallback attribute is provided to report the outcome of the SMS transmission.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"to\",\n    \"0-1\": \"The phone number that will receive the SMS message. If this parameter is not specified, the SMS will be sent back to the number that made the request to the Zang number’s SMS request URL.\",\n    \"1-0\": \"from\",\n    \"1-1\": \"The number that will display as sending the SMS message. This should be one of your Zang numbers. If this parameter is not specified, the default from number is the Zang number hosting the SMS request URL.\",\n    \"2-0\": \"action\",\n    \"2-1\": \"URL to direct Zang to once the `<Sms>` element is executed. Parameters specific to `<Sms>` are sent here along with the request.\",\n    \"3-0\": \"method\",\n    \"3-1\": \"Method used to request the action URL. Default Value: POST. Allowed Value: POST or GET.\",\n    \"4-0\": \"statusCallback\",\n    \"4-1\": \"URL where the status of the SMS can be sent.\",\n    \"h-0\": \"Attribute\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\nIn addition to the default voice request parameters, the following parameters are forwarded to the action URL.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Parameter\",\n    \"h-1\": \"Description\",\n    \"0-1\": \"The Sid Zang has assigned for the SMS message.\",\n    \"0-0\": \"SmsSid\",\n    \"1-0\": \"SmsStatus\",\n    \"1-1\": \"The current status of the SMS message. Either sent or failed.\",\n    \"2-0\": \"Body\",\n    \"2-1\": \"The text of the SMS message you want to send. 160 character limit.\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Nesting\",\n  \"body\": \"In addition to the default `<Response>` element, the `<Sms>` element cannot be nested within any other verbs. The `<Sms>` element cannot nest any other elements within itself. It must only nest the text which is to be sent in the message.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Tip\",\n  \"body\": \"By default, there is a 1 SMS per second rate limit on SMS messages. If you need to send SMS messages at a higher rate, please contact us.\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"SMS Filtering\",\n  \"body\": \"All Zang numbers which haven't yet had a user supplied SMS request URL set are provided with the following default SMS filtering behaviors:\\n\\n- If a recipient replies to a Zang SMS message with STOP, QUIT, or UNSUBSCRIBE, they will no longer receive SMS messages from that number.\\n- The keywords START, YES, or SUBSCRIBE revert this blocking.\\n- HELP informs the recipient of the above keywords.\\n\\nOnce an SMS request URL is set, this default behavior stops, allowing developers to implement their own SMS filtering solution.\"\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Examples\"\n}\n[/block]\nThe InboundXML below will say “I will now send an SMS!” and then send an SMS that reads “Test message sent from Zang!” to the specified from number.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<Response>\\n  <Say>I will now send an SMS!</Say>\\n    <Sms from=\\\"{phone_number}\\\" to=\\\"{phone_number}\\\">Test message sent from Zang!</Sms>\\n</Response>\",\n      \"language\": \"xml\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"sms","type":"basic","title":"<Sms>"}
Zang allows SMS messages to be sent during a call using the `<Sms>` element. The SMS receiver (to attribute) must be a valid phone number. The sender (from attribute) must be one of your registered Zang numbers. The text of the message should be placed inside the element and can not be longer than 160 characters. The action attribute can be used to direct the SMS to a new InboundXML document for processing. If directed to a new InboundXML using the action attribute, all InboundXML beneath the `<Sms>` element in the originating InboundXML document is disregarded. Similarly, the statusCallback attribute is provided to report the outcome of the SMS transmission. [block:parameters] { "data": { "0-0": "to", "0-1": "The phone number that will receive the SMS message. If this parameter is not specified, the SMS will be sent back to the number that made the request to the Zang number’s SMS request URL.", "1-0": "from", "1-1": "The number that will display as sending the SMS message. This should be one of your Zang numbers. If this parameter is not specified, the default from number is the Zang number hosting the SMS request URL.", "2-0": "action", "2-1": "URL to direct Zang to once the `<Sms>` element is executed. Parameters specific to `<Sms>` are sent here along with the request.", "3-0": "method", "3-1": "Method used to request the action URL. Default Value: POST. Allowed Value: POST or GET.", "4-0": "statusCallback", "4-1": "URL where the status of the SMS can be sent.", "h-0": "Attribute", "h-1": "Description" }, "cols": 2, "rows": 5 } [/block] In addition to the default voice request parameters, the following parameters are forwarded to the action URL. [block:parameters] { "data": { "h-0": "Parameter", "h-1": "Description", "0-1": "The Sid Zang has assigned for the SMS message.", "0-0": "SmsSid", "1-0": "SmsStatus", "1-1": "The current status of the SMS message. Either sent or failed.", "2-0": "Body", "2-1": "The text of the SMS message you want to send. 160 character limit." }, "cols": 2, "rows": 3 } [/block] [block:callout] { "type": "info", "title": "Nesting", "body": "In addition to the default `<Response>` element, the `<Sms>` element cannot be nested within any other verbs. The `<Sms>` element cannot nest any other elements within itself. It must only nest the text which is to be sent in the message." } [/block] [block:callout] { "type": "warning", "title": "Tip", "body": "By default, there is a 1 SMS per second rate limit on SMS messages. If you need to send SMS messages at a higher rate, please contact us." } [/block] [block:callout] { "type": "danger", "title": "SMS Filtering", "body": "All Zang numbers which haven't yet had a user supplied SMS request URL set are provided with the following default SMS filtering behaviors:\n\n- If a recipient replies to a Zang SMS message with STOP, QUIT, or UNSUBSCRIBE, they will no longer receive SMS messages from that number.\n- The keywords START, YES, or SUBSCRIBE revert this blocking.\n- HELP informs the recipient of the above keywords.\n\nOnce an SMS request URL is set, this default behavior stops, allowing developers to implement their own SMS filtering solution." } [/block] [block:api-header] { "type": "basic", "title": "Examples" } [/block] The InboundXML below will say “I will now send an SMS!” and then send an SMS that reads “Test message sent from Zang!” to the specified from number. [block:code] { "codes": [ { "code": "<Response>\n <Say>I will now send an SMS!</Say>\n <Sms from=\"{phone_number}\" to=\"{phone_number}\">Test message sent from Zang!</Sms>\n</Response>", "language": "xml" } ] } [/block]