{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/HttpServices/SendMessage.ashx","auth":"required","settings":"","examples":{"codes":[{"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);","name":null,"language":"csharp"},{"language":"curl","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\""}]},"method":"get","params":[{"name":"user","type":"string","default":"","desc":"Registered Dynmark Username","required":true,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8dd"},{"name":"password","type":"string","default":"","desc":"Registered Dynmark Password","required":true,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8dc"},{"name":"to","type":"string","default":"","desc":"Either a single international format mobile number, or a list of comma international format delimited numbers e.g. 447123123456","required":true,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8db"},{"name":"text","type":"string","default":"","desc":"The message text","required":true,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8da"},{"name":"from","type":"string","default":"","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","required":false,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8d9"},{"name":"validitymins","type":"int","default":"","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.","required":false,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8d8"},{"name":"deliverAfter","type":"datetime","default":"","desc":"A date time in XML date format, specifying when we should try to deliver the message.","required":false,"in":"query","ref":"","_id":"56b365c278a12121009006e1"},{"name":"deliverystatusurl","type":"string","default":"","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","required":false,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8d7"},{"name":"clientreference","type":"string","default":"","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.","required":false,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8d6"},{"name":"filtersetname","type":"string","default":"","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.","required":false,"in":"query","ref":"","_id":"568fd82b21fcf0190071d8d5"}],"results":{"codes":[{"status":200,"language":"xml","code":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SendMessage>\n <Response TransactionID=\"20122991\" />\n</SendMessage>","name":""},{"status":500,"language":"xml","code":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SendMessage status=\"failed\">\n\t<failureDescription>Unable to logon with credentials given</failureDescription>\n</SendMessage>","name":"Bad Credentials"},{"status":500,"name":"Bad Parameters","language":"xml","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>"},{"code":"<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<SendMessage status=\"failed\">\n <failureDescription>The mobile number supplied is invalid '4'</failureDescription>\n</SendMessage>","name":"Bad Parameters","status":500,"language":"xml"}]}},"next":{"description":"","pages":[]},"title":"SendMessage","type":"endpoint","slug":"http-messaging-sendmessage","excerpt":"Send an SMS message to one or more international phone numbers using a HTTP GET request.","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]","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"568fd72c769f210d0013252d","project":"568fce2a04440a1700e4cb47","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["568fce2b04440a1700e4cb4b","568fd1b8b700ce0d002f4b1c","568fd23804440a1700e4cb5b","568fd2444719c119002ce5d8","568ff21204440a1700e4cbc1","5693732c8aa8040d009f2c28","5693738393445b0d00abdad0","5693740093445b0d00abdad1","56937445974aaa0d001ca699","5693b82173f48f0d0075c90d","5694c4cd1005590d0062cb25","569f854466a5640d00efa54c","56a264cdd15dd70d008d825b","56aa56bf318e6c1700a19ddb","56b0e6347ae4550d000627bd","56b200c0f48f270d00e0de6f","56b200c6f48f270d00e0de70","56b22a9665ddf50d0076ba40","56e92ef71996862200fd7f42","574d6577fb835c0e00ca316a"],"_id":"568fce2b04440a1700e4cb4a","project":"568fce2a04440a1700e4cb47","__v":20,"createdAt":"2016-01-08T14:56:43.101Z","releaseDate":"2016-01-08T14:56:43.101Z"},"__v":2,"editedParams2":true,"category":{"sync":{"isSync":false,"url":""},"pages":["568fd72c769f210d0013252d","568febf9b700ce0d002f4b61","568fef14769f210d00132570","5694c4f55f1c951900644dda"],"title":"HTTP API","slug":"http-services","order":6,"from_sync":false,"reference":false,"_id":"568fd1b8b700ce0d002f4b1c","version":"568fce2b04440a1700e4cb4a","__v":4,"createdAt":"2016-01-08T15:11:52.382Z","project":"568fce2a04440a1700e4cb47"},"githubsync":"","parentDoc":null,"user":"55116f88e2990b0d00fb0552","createdAt":"2016-01-08T15:35:08.196Z","editedParams":true}
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.