{"_id":"568fd72c769f210d0013252d","project":"568fce2a04440a1700e4cb47","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"},"__v":2,"editedParams2":true,"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"},"parentDoc":null,"user":"55116f88e2990b0d00fb0552","editedParams":true,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-01-08T15:35:08.196Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[{"language":"csharp","name":null,"code":"string returnValue = null;\nHttpWebResponse response = null;\nHttpStatusCode? lastHttpStatus = null;\n\nvar parameters = new Dictionary<string, string>()\n{\n\t{ \"user\", \"#USERNAME#\" },\n\t{ \"password\", \"#PASSWORD#\" },\n\t{ \"to\", \"447700000000\" },\n\t{ \"from\", \"Test\" },\n\t{ \"text\", \"A test message from the example code.\" }\n};\n\nvar array = \n (from kvp in parameters\n\t select string.Format(\"{0}={1}\",\n HttpUtility.UrlEncode(kvp.Key),\n HttpUtility.UrlEncode(kvp.Value))).ToArray();\n\nHttpWebRequest request = (HttpWebRequest)WebRequest.Create(\n \"https://services.dynmark.com/HttpServices/SendMessage.ashx?\" + string.Join(\"&\", array));\nrequest.Method = \"GET\";\nrequest.ContentLength = 0;\nrequest.Timeout = 130000;\n\ntry\n{\n\tresponse = (HttpWebResponse)request.GetResponse();\n\tlastHttpStatus = response.StatusCode;\n\tusing (StreamReader sr = new StreamReader(response.GetResponseStream(), Encoding.UTF8))\n\t{\n\t\treturnValue = sr.ReadToEnd();\n\t}\n}\ncatch (System.Net.WebException wex)\n{\n\tif (wex.Response != null)\n\t{\n\t\tlastHttpStatus = ((HttpWebResponse)(wex.Response)).StatusCode;\n\t\tusing (StreamReader sr = new StreamReader(wex.Response.GetResponseStream(), Encoding.UTF8))\n\t\t{\n\t\t\treturnValue = sr.ReadToEnd();\n\t\t}\n\t}\n\telse if (wex.Status == WebExceptionStatus.Timeout)\n\t{\n\t\tlastHttpStatus = HttpStatusCode.RequestTimeout;\n\t}\n}\n\nConsole.WriteLine(lastHttpStatus);\nConsole.WriteLine(returnValue);"},{"code":"curl -X GET \"https://services.dynmark.com/HttpServices/SendMessage.ashx\" \\\n--data-urlencode \"user=#USER#\" \\\n--data-urlencode \"password=#PASSWORD#\" \\\n--data-urlencode \"to=447700000000\" \\\n--data-urlencode \"from=Test\" \\\n--data-urlencode \"text=Hello, this is a test message\"","language":"curl"}]},"method":"get","results":{"codes":[{"name":"","code":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SendMessage>\n <Response TransactionID=\"20122991\" />\n</SendMessage>","language":"xml","status":200},{"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","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>","language":"xml","name":"Bad Parameters","status":500},{"language":"xml","status":500,"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>"}]},"auth":"required","params":[{"_id":"568fd82b21fcf0190071d8dd","ref":"","in":"query","required":true,"desc":"Registered Dynmark Username","default":"","type":"string","name":"user"},{"_id":"568fd82b21fcf0190071d8dc","ref":"","in":"query","required":true,"desc":"Registered Dynmark Password","default":"","type":"string","name":"password"},{"_id":"568fd82b21fcf0190071d8db","ref":"","in":"query","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":"query","required":true,"desc":"The message text","default":"","type":"string","name":"text"},{"_id":"568fd82b21fcf0190071d8d9","ref":"","in":"query","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":"query","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":"query","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":"query","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":"query","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":"query","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":1,"body":"The SendMessage method allows you to send a message to one or more international phones numbers using a simple HTTP GET request and query string 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\": \"*status* - contains the value \\\"failed\\\" if an error has occurred, otherwise not present\",\n \"h-0\": \"Element\",\n \"h-1\": \"Attributes\",\n \"1-0\": \" failureDescription\",\n \"1-1\": \"\",\n \"2-0\": \" Response\",\n \"2-1\": \"*TransactionID* - The unique transaction identifier for the message send.\",\n \"h-2\": \"Description\",\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 GET request.","slug":"http-messaging-sendmessage","type":"endpoint","title":"SendMessage"}
getSendMessage
Send an SMS message to one or more international phone numbers using a HTTP GET request.
Definition
{{ api_url }}{{ page_api_url }}
Parameters
Query 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.