{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/WebServices/MessagingServicesWS.asmx","auth":"required","settings":"","examples":{"codes":[{"code":"var parameters = new\n{\n \"from\": \"Test\",\n \"to\": \"447979080215\",\n \"body\": \"Hello, this is a test message\"\n \"deliverAfter\": \"2015-10-05T12:57:00.543Z\",\n \"clientRef\": \"124546\"\n};\n\nvar client = new RestClient(\"https://services.dynmark.com/webapi/message/send\");\nvar request = new RestRequest(Method.POST);\nrequest.Authenticator = new HttpBasicAuthenticator(userName, password);\nrequest.AddHeader(\"accept\", \"application/json\");\nrequest.AddHeader(\"content-type\", \"application/json\");\nrequest.AddParameter(\"application/json\", \"[{\\n \\\"from\\\": \\\"Test\\\",\\n \\\"to\\\": \\\"447979080215\\\",\\n \\\"body\\\": \\\"Hello, this is a test message\\\"\\n}]\\n\", ParameterType.RequestBody);\nIRestResponse response = client.Execute(request);\n","language":"csharp","name":null},{"code":"curl -X POST -H \"Content-Type: application/json\" -H \"Accept: application/json\" -user #USER#:#PASSWORD# -H \"Cache-Control: no-cache\" -H \"Postman-Token: 30948295-e763-a276-525c-b83a1b948447\" -d '{\n \"from\": \"Test\",\n \"to\": \"447979080215\",\n \"body\": \"Hello, this is a test message\"\n \"deliverAfter\": \"2015-10-05T12:57:00.543Z\",\n \"clientRef\": \"124546\"\n}' 'https://services.dynmark.com/webapi/message/send'","language":"curl"},{"language":"java","code":"String userName = \"#USERNAME#\";\nString password = \"#PASSWORD#\";\n\nHttpResponse<String> response = Unirest.post(\"https://services.dynmark.com/webapi/message/send\")\n .header(\"content-type\", \"application/json\")\n .header(\"accept\", \"application/json\")\n .header(\"authorization\", \"Basic c3RnZHlubGl2ZXNjOlBhc3N3MHJkIQ==\")\n .header(\"cache-control\", \"no-cache\")\n .basicAuth(\"username\", \"password\")\n .body(\"{\\n \\\"from\\\": \\\"Test\\\",\\n \\\"to\\\": \\\"447979080215\\\",\\n \\\"body\\\": \\\"Hello, this is a test message\\\"\\n \\\"deliverAfter\\\": \\\"2015-10-05T12:57:00.543Z\\\",\\n \\\"clientRef\\\": \\\"124546\\\"\\n}\\n\")\n .asString();\n"},{"code":"var messages = [{\n \"from\": \"Test\",\n \"to\": \"447979080215\",\n \"body\": \"Hello, this is a test message\"\n \"deliverAfter\": \"2015-10-05T12:57:00.543Z\",\n \"clientRef\": \"124546\"\n}];\n\nvar settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://services.dynmark.com/webapi/message/send\",\n \"method\": \"POST\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"accept\": \"application/json\",\n \"username\": \"#USERNAME#\",\n \"password\": \"#PASSWORD#\",\n \"cache-control\": \"no-cache\"\n },\n \"processData\": false,\n \"data\": messages\n}\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});","language":"javascript"},{"language":"php","code":"<?php\n\n$username = \"#USERNAME#\";\n$password = \"#PASSWORD#\";\n\n$request = new HttpRequest();\n$request->setUrl('https://services.dynmark.com/webapi/message/send');\n$request->setMethod(HTTP_METH_POST);\n\n$request->setHeaders(array(\n 'cache-control' => 'no-cache',\n 'authorization' => 'Basic ' . base64_encode(\"$username:$password\")\n 'accept' => 'application/json',\n 'content-type' => 'application/json'\n));\n\n$request->setBody('{\n \"from\": \"Test\",\n \"to\": \"447979080215\",\n \"body\": \"Hello, this is a test message\"\n \"deliverAfter\": \"2015-10-05T12:57:00.543Z\",\n \"clientRef\": \"124546\"\n}\n');\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}"}]},"params":[{"name":"username","type":"string","default":"","desc":"","required":false,"in":"body","ref":"","_id":"569fb65c27af53210043231f"},{"name":"password","type":"string","default":"","desc":"","required":false,"in":"body","ref":"","_id":"569fb65c27af53210043231e"},{"name":"to","type":"string","default":"","desc":"The phone number to send to. This should be in international format (e.g. 447123123456), or if countryIsoCode is specified, in local format (e.g. 07123123456)","required":true,"in":"body","ref":"","_id":"568fd82b21fcf0190071d8db"},{"name":"from","type":"string","default":"","desc":"A string containing the from 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":true,"in":"body","ref":"","_id":"568fd82b21fcf0190071d8d9"},{"name":"countryIsoCode","type":"string","default":"","desc":"An optional country in <a href=\"https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3\">ISO 3166-1 alpha-3</a> format. If specfied, the <b>to</b> field can contain a number in local format, e.g. GBR would allow 07123123456","required":false,"in":"body","ref":"","_id":"56992cd4d342d51900438665"},{"name":"body","type":"string","default":"","desc":"The message text","required":true,"in":"body","ref":"","_id":"568fd82b21fcf0190071d8da"},{"name":"deliverAfter","type":"datetime","default":"","desc":"A date time specifying when we should try to deliver the message.","required":false,"in":"body","ref":"","_id":"5694caf9c5c5ce0d00058df4"},{"name":"validiUntil","type":"datetime","default":"","desc":"A date time specifying how long we should try to deliver the message for.","required":false,"in":"body","ref":"","_id":"568fd82b21fcf0190071d8d8"},{"name":"clientRef","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.","required":false,"in":"body","ref":"","_id":"568fd82b21fcf0190071d8d6"},{"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":"body","ref":"","_id":"568fd82b21fcf0190071d8d7"},{"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":"body","ref":"","_id":"568fd82b21fcf0190071d8d5"},{"name":"rejectUnicode","type":"boolean","default":"false","desc":"If set to true, any messages containing unicode characters will not be sent.","required":false,"in":"body","ref":"","_id":"5697d9023503e40d0061f49b"},{"name":"impersonateUserName","type":"string","default":"","desc":"If you are a reseller and have requested the send as client feature, you can specify the username of one of your clients to send messages using that client’s account.","required":false,"in":"body","ref":"","_id":"5694caf9c5c5ce0d00058df1"}],"results":{"codes":[{"status":200,"language":"json","code":"[\n {\n },\n {\n }\n]","name":""},{"status":202,"language":"json","code":"[{\n\t\"failureDescription\":\"Unable to logon with credentials given\",\n}]","name":""},{"status":400,"language":"json","code":"[\n {\n \"property\": \"message[0].toa\",\n \"details\": \"Could not find member 'toa' on object of type 'Message'. Path '[0].toa', line 3, position 10.\",\n \"failureKey\": \"ErrBadJson\"\n },\n {\n \"property\": \"message[1].toa\",\n \"details\": \"Could not find member 'toa' on object of type 'Message'. Path '[1].toa', line 7, position 10.\",\n \"failureKey\": \"ErrBadJson\"\n },\n {\n \"property\": \"message[1].body\",\n \"details\": \"After parsing a value an unexpected character was encountered: \\\". Path '[1].body', line 9, position 4.\\nAfter parsing a value an unexpected character was encountered: \\\". Path '[1].body', line 9, position 4.\",\n \"failureKey\": \"ErrBadJson\"\n }\n]"},{"status":401,"language":"text","code":"No authorization header supplied or invalid username or password"}]}},"next":{"description":"","pages":[]},"title":"SendMessageCollection","type":"fn","slug":"soap-messaging-sendmessagecollection","excerpt":"Send SMS messages to one or more international phone numbers.","body":"The SendMessageCollection method allows you to send single or multiple messages to one or more international phones numbers. With it you can send:\n* a single message to a single phone number\n* the same message to multiple phone numbers\n* different messages to multiple phone numbers\n[block:callout]\n{\n \"type\": \"info\",\n \"title\": \"We recommended a maximum of 250 messages are submitted in a single call to this method.\"\n}\n[/block]\n\n[block:callout]\n{\n \"type\": \"danger\",\n \"title\": \"Any non GSM character will cause your SMS to be sent as a Unicode message\",\n \"body\": \"If your message contains **any** characters that are not included in the [GSM](https://comapi.zendesk.com/hc/en-us/articles/206917189-GSM-Alphabet-Character-Set-) or [Extended GSM](https://comapi.zendesk.com/hc/en-us/articles/206917189-GSM-Alphabet-Character-Set-) character sets then the message will be encoded entirely as Unicode (UTF-16) and therefore each character will take 16 bits instead of 7 bits more than **halving the amount of characters per SMS and potentially doubling your costs!**\\n\\nFind out more about [SMS Message Encoding](doc:message-encoding)\\nFind out more about [SMS Message Segmentation](doc:message-segmentation)\"\n}\n[/block]\n<div class=\"alert alert-success\"><div class=\"label label-success\">SOAP Action</div> **http://<span></span>www.services.dynmark.com/SendMessageCollection**</div>\n\n**Note**: Parameter and property names shown in bold are required\n[block:parameters]\n{\n \"data\": {\n \"0-0\": \"<code>name</code><span class=\\\"c-danger\\\">*</span>\",\n \"1-0\": \"<code>password</code><span class=\\\"c-danger\\\">*</span>\",\n \"2-0\": \"<code>message</code><span class=\\\"c-danger\\\">*</span>\",\n \"2-1\": \"An array of one or more [Message](#section-message-object) objects\",\n \"1-1\": \"Registered Dynmark password\",\n \"0-1\": \"Registered Dynmark username\",\n \"h-0\": \"Parameter\",\n \"h-1\": \"Description\"\n },\n \"cols\": 2,\n \"rows\": 3\n}\n[/block]\n##Message Object\nNote: Field names shown in bold are required whereas non-bold are optional\n[block:parameters]\n{\n \"data\": {\n \"0-0\": \"<code>recipients</code><span class=\\\"c-danger\\\">*</span>\",\n \"1-0\": \"<code>text</code><span class=\\\"c-danger\\\">*</span>\",\n \"2-0\": \"<code>originator</code>\",\n \"0-1\": \"An array of strings, each string containing a single international format phone number, e.g. 447123123456\",\n \"1-1\": \"The message text\",\n \"2-1\": \"A string containing the originator (from) value.\\nThis can be either:\\n* Numeric: between 2-15 characters, permitted characters 0-9 \\n* Alphanumeric: between 2-11 characters 0-9, a-z, A-Z, hyphen, underscore, full-stop and space e.g. MAYFLOWER.\\nIf 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.\",\n \"3-0\": \"<code>validUntil</code>\",\n \"4-0\": \"<code>deliverAfter</code>\",\n \"5-0\": \"<code>clientRef</code>\",\n \"6-0\": \"<code>deliveryStatusUrl</code>\",\n \"9-0\": \"<code>filterSetName</code>\",\n \"10-0\": \"<code>impersonateUserName</code>\",\n \"11-0\": \"<code>messageGuid</code>\",\n \"11-1\": \"An optional unique identifier for this submission. If the supplied value matches a previous submitted value, the associated messages are assumed to be a duplicate submission and are ignored. The value can be any string up to 36 characters long although we recommend the use of a GUID to ensure uniqueness. If a value is not specified, the service generates a new GUID.\",\n \"10-1\": \"If you are a reseller and have requested the send as client feature, you can specify the username of one of your clients to send messages using that client’s account.\",\n \"9-1\": \"If you have enabled Intelligent Filtering on your account, in the user portal, you can specify which filter set is applied to this message.\",\n \"6-1\": \"A callback URL that will have the delivery status for the SMS sent to it. See [Receipt Forwarding](receipt-handler) for more details.\",\n \"5-1\": \"An 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.\",\n \"4-1\": \"A date time in XML date format, specifying when we should try to deliver the message.\",\n \"3-1\": \"A date time in XML date format, specifying how long we should try to deliver the message for.\",\n \"h-0\": \"Property\",\n \"h-1\": \"Description\",\n \"12-0\": \"<code>additionalOptions</code>\",\n \"12-1\": \"A list of SMPP options expressed as key value pairs that are forwarded to the carrier.\",\n \"7-0\": \"<code>forwardSubmissionDeliveryStatus</code>\",\n \"8-0\": \"<code>includeMessageTextInDeliveryStatus</code>\",\n \"7-1\": \"When set to true, a “message sent” delivery status will be sent to *deliveryStatusUrl* in addition to final statuses for each message. Defaults to false.\",\n \"8-1\": \"When set to true, the information forwarded to *deliveryStatusUrl* will also include a *messagetext* field. Defaults to false.\"\n },\n \"cols\": 2,\n \"rows\": 13\n}\n[/block]\n##Returns\nA SendMessageCollectionResult object an array of containing one or more [MessageResult](#section-messageresult-object) objects, each corresponding to each of the submitted Message objects.\n\n##MessageResult Object\n[block:parameters]\n{\n \"data\": {\n \"h-0\": \"Property\",\n \"h-1\": \"Description\",\n \"0-0\": \"<code>transactionID</code><span class=\\\"c-danger\\\">*</span>\",\n \"1-0\": \"<code>recipients</code><span class=\\\"c-danger\\\">*</span>\",\n \"2-0\": \"<code>returnCode</code>\",\n \"3-0\": \"<code>returnDescription</code>\",\n \"4-0\": \"<code>returnDetail</code>\",\n \"4-1\": \"If the return code was a failure, this field contains a verbose description of the failure if one is available.\",\n \"3-1\": \"If the return code was a failure, this field contains a brief description of the failure.\",\n \"2-1\": \"If there was a failure during message processing, this contains the failure code.\",\n \"1-1\": \"An array of strings containing the recipients that this transaction was sent to.\",\n \"0-1\": \"An integer containing the transaction ID of the send.\"\n },\n \"cols\": 2,\n \"rows\": 5\n}\n[/block]\n##Request Examples\n[block:code]\n{\n \"codes\": [\n {\n \"code\": \"<soapenv:Envelope xmlns:soapenv=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n <soapenv:Header/>\\n <soapenv:Body>\\n <SendMessageCollection xmlns=\\\"http://www.services.dynmark.com/\\\">\\n <name>:::at:::[email protected]</name>\\n <password>@[email protected]</password>\\n <message>\\n <Message>\\n <originator>Example</originator>\\n <recipients>\\n <string>447700900000</string>\\n </recipients>\\n <text>Hello, this is a test message</text>\\n <clientRef>Your reference</clientRef>\\n </Message>\\n </message>\\n </SendMessageCollection>\\n </soapenv:Body>\\n</soapenv:Envelope>\",\n \"language\": \"xml\",\n \"name\": \"Simple Send\"\n },\n {\n \"code\": \"<soapenv:Envelope xmlns:soapenv=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n <soapenv:Header/>\\n <soapenv:Body>\\n \\t \\t<SendMessageCollection xmlns=\\\"http://www.services.dynmark.com/\\\">\\n <name>@[email protected]</name>\\n <password>@[email protected]</password>\\n <message>\\n <Message>\\n <originator>Example</originator>\\n <recipients>\\n <string>447700900000</string>\\n </recipients>\\n <text>Hello, this is a test message</text>\\n <clientRef>Your reference</clientRef>\\n <deliveryStatusURL>https://inbound.example.com/SmsReceipts</deliveryStatusURL>\\n </Message>\\n </message>\\n </SendMessageCollection>\\n </soapenv:Body>\\n</soapenv:Envelope>\",\n \"language\": \"xml\",\n \"name\": \"Send with Receipts\"\n },\n {\n \"code\": \"<soapenv:Envelope xmlns:soapenv=\\\"http://schemas.xmlsoap.org/soap/envelope/\\\">\\n <soapenv:Header/>\\n <soapenv:Body>\\n \\t \\t<SendMessageCollection xmlns=\\\"http://www.services.dynmark.com/\\\">\\n <name>@[email protected]</name>\\n <password>@[email protected]</password>\\n <message>\\n <Message>\\n <originator>Example</originator>\\n <recipients>\\n <string>447700900000</string>\\n </recipients>\\n <text>Hello, this is a test message</text>\\n <clientRef>Your reference</clientRef>\\n </Message>\\n <Message>\\n <originator>Example</originator>\\n <recipients>\\n <string>447700900111</string>\\n </recipients>\\n <text>Hello, this is another test message</text>\\n <clientRef>Your second reference</clientRef>\\n </Message>\\n </message>\\n </SendMessageCollection>\\n </soapenv:Body>\\n</soapenv:Envelope>\",\n \"language\": \"xml\",\n \"name\": \"Batch Sends\"\n }\n ]\n}\n[/block]","updates":[],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"569fb65c27af53210043231d","parentDoc":null,"category":{"sync":{"isSync":false,"url":""},"pages":["569fb6a8b4f2d31900898ced","56ab2dc70b9e0b0d006161c4","56efbfcb20419a0e00113caa"],"title":"SOAP API","slug":"soap-web-services","order":7,"from_sync":false,"reference":false,"_id":"568fd23804440a1700e4cb5b","project":"568fce2a04440a1700e4cb47","__v":3,"createdAt":"2016-01-08T15:14:00.072Z","version":"568fce2b04440a1700e4cb4a"},"editedParams2":true,"__v":2,"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"},"user":"55116f88e2990b0d00fb0552","createdAt":"2016-01-20T16:31:24.052Z","editedParams":true,"githubsync":"","project":"568fce2a04440a1700e4cb47"}
SendMessageCollection
Send SMS messages to one or more international phone numbers.