{"_id":"572b20e0b352ab0e003dab35","category":{"_id":"568fd1b8b700ce0d002f4b1c","pages":["568fd72c769f210d0013252d","568febf9b700ce0d002f4b61","568fef14769f210d00132570","5694c4f55f1c951900644dda"],"version":"568fce2b04440a1700e4cb4a","__v":4,"project":"568fce2a04440a1700e4cb47","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-08T15:11:52.382Z","from_sync":false,"order":6,"slug":"http-services","title":"HTTP API"},"project":"568fce2a04440a1700e4cb47","editedParams":true,"parentDoc":null,"__v":0,"editedParams2":true,"user":"55114030a226890d00911658","version":{"_id":"568fce2b04440a1700e4cb4a","project":"568fce2a04440a1700e4cb47","__v":20,"createdAt":"2016-01-08T14:56:43.101Z","releaseDate":"2016-01-08T14:56:43.101Z","categories":["568fce2b04440a1700e4cb4b","568fd1b8b700ce0d002f4b1c","568fd23804440a1700e4cb5b","568fd2444719c119002ce5d8","568ff21204440a1700e4cbc1","5693732c8aa8040d009f2c28","5693738393445b0d00abdad0","5693740093445b0d00abdad1","56937445974aaa0d001ca699","5693b82173f48f0d0075c90d","5694c4cd1005590d0062cb25","569f854466a5640d00efa54c","56a264cdd15dd70d008d825b","56aa56bf318e6c1700a19ddb","56b0e6347ae4550d000627bd","56b200c0f48f270d00e0de6f","56b200c6f48f270d00e0de70","56b22a9665ddf50d0076ba40","56e92ef71996862200fd7f42","574d6577fb835c0e00ca316a"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-05-05T10:30:56.143Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[{"language":"csharp","code":"var client = new RestClient(\"https://services.dynmark.com/HttpServices/SendMessage.ashx\");\nvar request = new RestRequest(Method.POST);\n\nrequest.AddHeader(\"content-type\", \"application/x-www-form-urlencoded\");\nrequest.AddHeader(\"cache-control\", \"no-cache\");\nrequest.AddParameter(\"application/x-www-form-urlencoded\", \"user=YourUsername&password=YourPassword&to=447777123123&text=A%20test%20from%20SendMessage%20using%20POST&from=NoReply\", ParameterType.RequestBody);\n\nIRestResponse response = client.Execute(request);","name":"C# (Using RestSharp)"},{"language":"curl","code":"curl -X POST -H \"Cache-Control: no-cache\" -H \"Content-Type: application/x-www-form-urlencoded\" -d 'user=YourUsernamey&password=YourPassword&to=447777123123&text=A test from SendMessage using POST&from=NoReply' \"https://services.dynmark.com/HttpServices/SendMessage.ashx\""}]},"method":"post","results":{"codes":[{"status":200,"name":"","code":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SendMessage>\n  <Response TransactionID=\"20122991\" />\n</SendMessage>","language":"xml"},{"language":"xml","status":500,"name":"Bad Credentials","code":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SendMessage status=\"failed\">\n\t<failureDescription>Unable to logon with credentials given</failureDescription>\n</SendMessage>"},{"language":"xml","name":"Bad Parameters","status":500,"code":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SendMessage status=\"failed\">\n    <failureDescription>Invalid parameters passed; the errors are as follows:\nYou must specify the 'to' parameter with a comma delimited list of international numbers e.g. 447000000000\n</failureDescription>\n</SendMessage>"},{"name":"Bad Parameters","code":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SendMessage status=\"failed\">\n    <failureDescription>The mobile number supplied is invalid '4'</failureDescription>\n</SendMessage>","language":"xml","status":500}]},"auth":"required","params":[{"_id":"568fd82b21fcf0190071d8dd","ref":"","in":"body","required":true,"desc":"Registered Dynmark Username","default":"","type":"string","name":"user"},{"_id":"568fd82b21fcf0190071d8dc","ref":"","in":"body","required":true,"desc":"Registered Dynmark Password","default":"","type":"string","name":"password"},{"_id":"568fd82b21fcf0190071d8db","ref":"","in":"body","required":true,"desc":"Either a single international format mobile number, or a list of comma international format delimited numbers e.g. 447123123456","default":"","type":"string","name":"to"},{"_id":"568fd82b21fcf0190071d8da","ref":"","in":"body","required":true,"desc":"The message text","default":"","type":"string","name":"text"},{"_id":"568fd82b21fcf0190071d8d9","ref":"","in":"body","required":false,"desc":"A string containing the originator value. This can be either: Numeric: between 2-15 characters, permitted characters 0-9 Alphanumeric: between 2-11 characters 0-9, a-z, A-Z, hyphen, underscore, full-stop and space e.g. MAYFLOWER or +447740101097. If no originator is set this will automatically assign a default number so that the recipient may reply to the message. If you have purchased a dedicated number this can be used as the originator","default":"","type":"string","name":"from"},{"_id":"568fd82b21fcf0190071d8d8","ref":"","in":"body","required":false,"desc":"An integer value in minutes for how long we should try to deliver the message for e.g. a value of 60 would ensure the SMS is delivered within 60 minutes or not at all.","default":"","type":"int","name":"validitymins"},{"_id":"56b365c278a12121009006e1","ref":"","in":"body","required":false,"desc":"A date time in XML date format, specifying when we should try to deliver the message.","default":"","type":"datetime","name":"deliverAfter"},{"_id":"568fd82b21fcf0190071d8d7","ref":"","in":"body","required":false,"desc":"A callback URL that will have the delivery status for the SMS sent to it. The page located at the URL will need to return a HTTP status code of 200 to indicate it has accepted the data within 10 seconds. See the <a href=\"receipt-handler\">Receipt handler documentation</a> for more details","default":"","type":"string","name":"deliverystatusurl"},{"_id":"568fd82b21fcf0190071d8d6","ref":"","in":"body","required":false,"desc":"This can contain an optional string value (with a maximum length of 64 characters) that will be returned with the delivery status to allow you to pass integration information. See [Tracking Conversations](doc:tracking-converstations) for more details.","default":"","type":"string","name":"clientreference"},{"_id":"568fd82b21fcf0190071d8d5","ref":"","in":"body","required":false,"desc":"If you have enabled Intelligent Filtering on your account, in the user portal, you can specify which filter set is applied to this message.","default":"","type":"string","name":"filtersetname"}],"url":"/HttpServices/SendMessage.ashx"},"isReference":false,"order":2,"body":"The SendMessage method allows you to send a message to one or more international phones numbers using a simple HTTP POST request and from data parameters.\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Response XML\"\n}\n[/block]\nThe response from called this service will be returned as an XML document with UTF-8 encoding the format of the XML is explained in this section.\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"SendMessage\",\n    \"0-1\": \"\",\n    \"h-0\": \"Element\",\n    \"h-1\": \"Attributes\",\n    \"1-0\": \"&nbsp;&nbsp;&nbsp;&nbsp;failureDescription\",\n    \"1-1\": \"\",\n    \"2-0\": \"&nbsp;&nbsp;&nbsp;&nbsp;Response\",\n    \"2-1\": \"*TransactionID* - The unique transaction identifier for the message send.\",\n    \"h-2\": \"Description\",\n    \"0-1\": \"*status* - contains the value \\\"failed\\\" if an error has occurred, otherwise not present\",\n    \"1-2\": \"Only present if an error has occurred and contains a description of the error\",\n    \"2-2\": \"Only present if the submission is successful to communicate this and return the transaction id for the message send\"\n  },\n  \"cols\": 3,\n  \"rows\": 3\n}\n[/block]","excerpt":"Send an SMS message to one or more international phone numbers using a HTTP POST request.","slug":"http-messaging-sendmessage-post","type":"endpoint","title":"SendMessage"}

postSendMessage

Send an SMS message to one or more international phone numbers using a HTTP POST request.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

user:
required
string
Registered Dynmark Username
password:
required
string
Registered Dynmark Password
to:
required
string
Either a single international format mobile number, or a list of comma international format delimited numbers e.g. 447123123456
text:
required
string
The message text
from:
string
A string containing the originator value. This can be either: Numeric: between 2-15 characters, permitted characters 0-9 Alphanumeric: between 2-11 characters 0-9, a-z, A-Z, hyphen, underscore, full-stop and space e.g. MAYFLOWER or +447740101097. If no originator is set this will automatically assign a default number so that the recipient may reply to the message. If you have purchased a dedicated number this can be used as the originator
validitymins:
integer
An integer value in minutes for how long we should try to deliver the message for e.g. a value of 60 would ensure the SMS is delivered within 60 minutes or not at all.
deliverAfter:
datetime
A date time in XML date format, specifying when we should try to deliver the message.
deliverystatusurl:
string
A callback URL that will have the delivery status for the SMS sent to it. The page located at the URL will need to return a HTTP status code of 200 to indicate it has accepted the data within 10 seconds. See the <a href="receipt-handler">Receipt handler documentation</a> for more details
clientreference:
string
This can contain an optional string value (with a maximum length of 64 characters) that will be returned with the delivery status to allow you to pass integration information. See [Tracking Conversations](doc:tracking-converstations) for more details.
filtersetname:
string
If you have enabled Intelligent Filtering on your account, in the user portal, you can specify which filter set is applied to this message.

Examples


Result Format


Documentation

The SendMessage method allows you to send a message to one or more international phones numbers using a simple HTTP POST request and from data parameters. [block:api-header] { "type": "basic", "title": "Response XML" } [/block] The response from called this service will be returned as an XML document with UTF-8 encoding the format of the XML is explained in this section. [block:parameters] { "data": { "0-0": "SendMessage", "0-1": "", "h-0": "Element", "h-1": "Attributes", "1-0": "&nbsp;&nbsp;&nbsp;&nbsp;failureDescription", "1-1": "", "2-0": "&nbsp;&nbsp;&nbsp;&nbsp;Response", "2-1": "*TransactionID* - The unique transaction identifier for the message send.", "h-2": "Description", "0-1": "*status* - contains the value \"failed\" if an error has occurred, otherwise not present", "1-2": "Only present if an error has occurred and contains a description of the error", "2-2": "Only present if the submission is successful to communicate this and return the transaction id for the message send" }, "cols": 3, "rows": 3 } [/block]