{"__v":0,"_id":"56ab27478beeff0d003b801d","category":{"__v":11,"_id":"5694c4cd1005590d0062cb25","pages":["569f8c611082520d005c703a","569fa534a454d2230002cb72","569fa79197472b1700201634","569fb65c27af53210043231d","569fb6931082520d005c7085","56a0a29cd847b50d00a275f0","56a0ae0ac29eb50d00e33e05","56b9e47cb77e261700bc1425","56bb05b7fb70442b003683ee","56bb06ec959bd90d00afb0a2","56d41bbed3f4650b007496df"],"project":"568fce2a04440a1700e4cb47","version":"568fce2b04440a1700e4cb4a","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-12T09:18:05.741Z","from_sync":false,"order":5,"slug":"rest-services","title":"REST API"},"editedParams":true,"editedParams2":true,"parentDoc":null,"project":"568fce2a04440a1700e4cb47","user":"55116f88e2990b0d00fb0552","version":{"__v":20,"_id":"568fce2b04440a1700e4cb4a","project":"568fce2a04440a1700e4cb47","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-01-29T08:48:07.994Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"code":"var parameters = new[]\n{\n\tnew\n\t{\n\t    from = \"Test\",\n\t    to = \"447979080215\",\n\t    body = \"Hello, this is a test message\",\n\t    deliverAfter = \"2015-10-05T12:57:00.543Z\",\n\t    clientRef = \"124546\"\n\t}\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"},{"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","language":"java"},{"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}"}]},"results":{"codes":[{"name":"","code":"[\n  {\n  },\n  {\n  }\n]","language":"json","status":200},{"name":"","code":"[{\n\t\"failureDescription\":\"Unable to logon with credentials given\",\n}]","language":"json","status":202},{"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]","language":"json","status":400},{"code":"No authorization header supplied or invalid username or password","language":"text","status":401}]},"settings":"","auth":"required","params":[{"_id":"568fd82b21fcf0190071d8db","ref":"","in":"body","required":true,"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)","default":"","type":"string","name":"to"},{"_id":"568fd82b21fcf0190071d8d9","ref":"","in":"body","required":true,"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","default":"","type":"string","name":"from"},{"_id":"56992cd4d342d51900438665","ref":"","in":"body","required":false,"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","default":"","type":"string","name":"countryIsoCode"},{"_id":"568fd82b21fcf0190071d8da","ref":"","in":"body","required":true,"desc":"The message text","default":"","type":"string","name":"body"},{"_id":"5694caf9c5c5ce0d00058df4","ref":"","in":"body","required":false,"desc":"A date time specifying when we should try to deliver the message.","default":"","type":"datetime","name":"deliverAfter"},{"_id":"568fd82b21fcf0190071d8d8","ref":"","in":"body","required":false,"desc":"A date time specifying how long we should try to deliver the message for.","default":"","type":"datetime","name":"validiUntil"},{"_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.","default":"","type":"string","name":"clientRef"},{"_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":"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"},{"_id":"5697d9023503e40d0061f49b","ref":"","in":"body","required":false,"desc":"If set to true, any messages containing unicode characters will not be sent.","default":"false","type":"boolean","name":"rejectUnicode"},{"_id":"5694caf9c5c5ce0d00058df1","ref":"","in":"body","required":false,"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.","default":"","type":"string","name":"impersonateUserName"},{"_id":"569fc90fc0864f1700565155","ref":"","in":"body","required":false,"desc":"","default":"","type":"array_object","name":"x"}],"url":"/WebApi/Messaging/Send"},"isReference":false,"order":6,"body":"[block:callout]\n{\n  \"type\": \"info\",\n  \"body\": \"To use this method you must be a reseller with child user accounts.\",\n  \"title\": \"Note\"\n}\n[/block]\nThe ValidateNumbersForUserName method allows you to check check the validity of one or more phone numbers and whether the handset is currently on or off. You can also discover details about the network the phone number is on and whether the phone is outside its native country.\n\n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Performance Note\",\n  \"body\": \"We recommended a maximum of 250 phone numbers are submitted in a single call to this method.\"\n}\n[/block]\n<div class=\"alert alert-success\"><div class=\"label label-success\">POST</div> &nbsp; **https://<span></span>services.dynmark.com/WebApi/PhoneNumberValidation/ValidateNumbersForUserNames**</div>\n\n##Parameters\nSend requires an array of one or more Message objects.\n##ValidateNumbersForUserRequest Object\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"<code>Numbers<code>\",\n    \"0-1\": \"An array of ValidateNumbersForUserNames objects\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n##ValidateNumbersForUserNames Object\n[block:parameters]\n{\n  \"data\": {\n    \"1-0\": \"<code>Number</code><span class=\\\"c-danger\\\">*</span>\",\n    \"1-1\": \"The phone number to validate. This can be in international or local format.\",\n    \"1-2\": \"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)\",\n    \"2-0\": \"<code>IsInternational</code>\",\n    \"2-1\": \"If set to true, the supplied number is in international format.\",\n    \"2-2\": \"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. 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\",\n    \"3-2\": \"An optional country in ISO 3166-1 alpha-3 format. If specfied, the to field can contain a number in local format, e.g. GBR would allow 07123123456\",\n    \"3-1\": \"Determines which international dialling code is prepended to the normalised number when normalising local format numbers. This parameter accepts country codes in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.\",\n    \"3-0\": \"<code>RequiredCountryCode</code>\",\n    \"4-0\": \"**body**\",\n    \"4-1\": \"string\",\n    \"4-2\": \"The message text\",\n    \"5-0\": \"deliverAfter\",\n    \"6-0\": \"validiUntil\",\n    \"7-0\": \"clientRef\",\n    \"5-1\": \"DateTime\",\n    \"5-2\": \"A date time specifying when we should try to deliver the message.\",\n    \"6-2\": \"A date time specifying how long we should try to deliver the message for.\",\n    \"6-1\": \"DateTime\",\n    \"7-2\": \"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.\",\n    \"7-1\": \"string\",\n    \"8-0\": \"deliveryStatusUrl\",\n    \"9-0\": \"filterSetName\",\n    \"10-0\": \"rejectUnicode\",\n    \"9-2\": \"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    \"10-2\": \"If set to true, any messages containing Unicode characters will not be sent.\",\n    \"8-2\": \"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 Receipt handler documentation for more details\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"Description\",\n    \"8-1\": \"string\",\n    \"9-1\": \"string\",\n    \"10-1\": \"boolean\",\n    \"0-0\": \"<code>ImpersonateUserName</code><span class=\\\"c-danger\\\">*</span>\",\n    \"0-1\": \"The name of the user to act as for the validation of this number. This user will be billed for the action and must belong to one of your child accounts.\"\n  },\n  \"cols\": 2,\n  \"rows\": 4\n}\n[/block]\n##Response\nThe response is an array of ValidateNumberResponse objects\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"<code>OriginalNumber</code><span class=\\\"c-danger\\\">*</span>\",\n    \"0-1\": \"The phone number supplied in the request object.\",\n    \"1-0\": \"<code>NumberStatus</code><span class=\\\"c-danger\\\">*</span>\",\n    \"1-1\": \"The status of the phone number. This is one of the [NumberStatus](doc:number-status) integer values.\",\n    \"2-0\": \"<code>NormalisedNumber</code>\",\n    \"2-1\": \"The normalised number when supplying a localised number, e.g. 07770123456 is normalised to 447770123456.\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"3-0\": \"<code>NetworkDetails</code>\",\n    \"4-0\": \"<code>IMSI</code>\",\n    \"4-1\": \"The [IMSI](https://en.wikipedia.org/wiki/International_mobile_subscriber_identity) associated with the number.\",\n    \"3-1\": \"A [NetworkDetail](#section-networkdetail-object) element describing the network that the number belongs to.\"\n  },\n  \"cols\": 2,\n  \"rows\": 5\n}\n[/block]\n##NetworkDetail Object\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"<code>NetworkName</code>\",\n    \"1-0\": \"<code>NetworkPrefix</code>\",\n    \"1-1\": \"The network prefix, e.g. 7770\",\n    \"0-1\": \"The network name\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"2-0\": \"<code>CountryName</code>\",\n    \"2-1\": \"The country name.\",\n    \"3-0\": \"<code>CountryCode</code>\",\n    \"3-1\": \"A two digit country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format, e.g. GB\",\n    \"4-0\": \"<code>CountryIDD</code>\",\n    \"4-1\": \"The dialling code for the country, e.g. 44\",\n    \"5-0\": \"<code>RoamingNetworkName</code>\",\n    \"6-0\": \"<code>RoamingNetworkPrefix</code>\",\n    \"7-0\": \"<code>RoamingCountryName</code>\",\n    \"8-0\": \"<code>RoamingCountryCode</code>\",\n    \"5-1\": \"If the phone is roaming, the name of the network being used to carry\",\n    \"6-1\": \"If the phone is roaming, the network prefix, e.g. 7770. This will always be the same as the NetworkPrefix.\",\n    \"7-1\": \"If the phone is roaming, the name of the country it was last seen in.\",\n    \"8-1\": \"f the phone is roaming, the country code of the country it was last seen in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.\",\n    \"9-0\": \"<code>RoamingCountryIDD</code>\",\n    \"9-1\": \"If the phone is roaming, the dialling code of the country it was last seen in.\",\n    \"10-0\": \"<code>MCCMNC</code>\",\n    \"10-1\": \"The mobile country code and mobile network code.\",\n    \"11-0\": \"<code>IsPorted</code>\",\n    \"11-1\": \"Flag indicating that the number has been ported from one network to another.\",\n    \"12-0\": \"<code>PortedNetwork</code>\",\n    \"12-1\": \"The network the phone was ported from.\"\n  },\n  \"cols\": 2,\n  \"rows\": 13\n}\n[/block]\n##Response Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[{\\n\\t\\t\\\"OriginalNumber\\\" : \\\"447700900000\\\",\\n\\t\\t\\\"NumberStatus\\\" : 2,\\n\\t\\t\\\"NormalisedNumber\\\" : \\\"447700900000\\\",\\n\\t\\t\\\"NetworkDetails\\\" : {\\n\\t\\t\\t\\\"NetworkName\\\" : \\\"T-Mobile UK Limited\\\",\\n\\t\\t\\t\\\"NetworkPrefix\\\" : \\\"7905\\\",\\n\\t\\t\\t\\\"CountryName\\\" : \\\"United Kingdom \\\",\\n\\t\\t\\t\\\"CountryCode\\\" : \\\"GB\\\",\\n\\t\\t\\t\\\"CountryIDD\\\" : \\\"44\\\",\\n\\t\\t\\t\\\"RoamingNetworkName\\\" : \\\"T-Mobile UK Limited\\\",\\n\\t\\t\\t\\\"RoamingNetworkPrefix\\\" : \\\"7953\\\",\\n\\t\\t\\t\\\"RoamingCountryName\\\" : \\\"United Kingdom \\\",\\n\\t\\t\\t\\\"RoamingCountryCode\\\" : \\\"GB\\\",\\n\\t\\t\\t\\\"RoamingCountryIDD\\\" : \\\"44\\\",\\n\\t\\t\\t\\\"MCCMNC\\\" : \\\"23430\\\",\\n\\t\\t\\t\\\"IsPorted\\\" : false,\\n\\t\\t\\t\\\"PortedNetwork\\\" : \\\"T-Mobile UK Limited\\\",\\n\\t\\t\\t\\\"CountryIsoCode\\\" : \\\"GBR\\\",\\n\\t\\t\\t\\\"RoamingCountryIsoCode\\\" : \\\"GBR\\\"\\n\\t\\t},\\n\\t\\t\\\"IMSI\\\" : 234307161073403\\n\\t}\\n]\",\n      \"language\": \"json\",\n      \"name\": \"200 OK\"\n    },\n    {\n      \"code\": \"{\\n  \\\"ErrorDetail\\\":\\\"Invalid request data was supplied. Please check that your format of your request matches the API documentation.\\\",\\n  \\\"ErrorType\\\":\\\"String\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"400 Bad Request\"\n    },\n    {\n      \"code\": \"No authorization header supplied or invalid username or password\",\n      \"language\": \"text\",\n      \"name\": \"401 Unauthorized\"\n    }\n  ]\n}\n[/block]\n##Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"string username = \\\":::at:::Username@\\\";\\nstring password = \\\"@Password@\\\";\\n\\nvar body = new\\n{\\n  Numbers = new[]\\n  {\\n    new\\n    {\\n      \\\"ImpersonateUserName\\\": \\\"ChildAccountUser1\\\",\\n      \\\"Number\\\": \\\"447700900000\\\",\\n      \\\"IsInternational\\\": true,\\n    },\\n    new\\n    {\\n      \\\"ImpersonateUserName\\\": \\\"ChildAccountUser2\\\",\\n      \\\"Number\\\": \\\"07700900001\\\",\\n      \\\"IsInternational\\\": false,\\n      \\\"CountryIsoCode\\\": \\\"GBR\\\"\\n    }\\n  }\\n};\\n\\nvar client = new RestClient(\\\"https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames\\\");\\nclient.Authenticator = new HttpBasicAuthenticator(username, password);\\nclient.Timeout = 130000;\\n\\nvar request = new RestRequest();\\nrequest.AddJsonBody(body);\\nIRestResponse response = client.Post(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"curl -X POST -H \\\"Content-Type: application/json\\\" -H \\\"Accept: application/json\\\" -user @Username@:@Password@ -d '{\\n    \\\"Numbers\\\" : [{\\n        \\\"ImpersonateUserName\\\": \\\"ChildUser1\\\",\\n        \\\"Number\\\": \\\"447700900000\\\",\\n        \\\"IsInternational\\\": true\\n    },\\n    {\\n        \\\"ImpersonateUserName\\\": \\\"ChildUser2\\\",\\n        \\\"Number\\\": \\\"447979900000\\\",\\n        \\\"IsInternational\\\": false,\\n        \\\"RequiredCountryCode\\\": \\\"GBR\\\"\\n    }]\\n}\\n' 'https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames'\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"String username = \\\"@Username@\\\";\\nString password = \\\"@Password@\\\";\\n\\nHttpResponse<String> response = Unirest.post(\\\"https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .header(\\\"accept\\\", \\\"application/json\\\")\\n  .basicAuth(username, password)\\n  .body(\\\"{\\\\n    \\\\\\\"Numbers\\\\\\\" : [{\\\\n        \\\\\\\"ImpersonateUserName\\\\\\\": \\\\\\\"ChildUser1\\\\\\\", \\\\\\\"Number\\\\\\\": \\\\\\\"447700900000\\\\\\\",\\\\n        \\\\\\\"IsInternational\\\\\\\": true\\\\n    },\\\\n    {\\\\n        \\\\\\\"ImpersonateUserName\\\\\\\": \\\\\\\"ChildUser2\\\\\\\", \\\\\\\"Number\\\\\\\": \\\\\\\"447979900000\\\\\\\",\\\\n        \\\\\\\"IsInternational\\\\\\\": false,\\\\n        \\\\\\\"RequiredCountryCode\\\\\\\": \\\\\\\"GBR\\\\\\\"\\\\n    }]\\\\n}\\\\n\\\")\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var body = {\\n    \\\"Numbers\\\" : [{\\n        \\\"ImpersonateUserName\\\": \\\"ChildUser1\\\",\\n        \\\"Number\\\": \\\"447700900000\\\",\\n        \\\"IsInternational\\\": true\\n    },\\n    {\\n        \\\"ImpersonateUserName\\\": \\\"ChildUser2\\\",\\n        \\\"Number\\\": \\\"447979900000\\\",\\n        \\\"IsInternational\\\": false,\\n        \\\"RequiredCountryCode\\\": \\\"GBR\\\"\\n    }]\\n};\\n\\nvar settings = {\\n  \\\"async\\\": true,\\n  \\\"crossDomain\\\": true,\\n  \\\"url\\\": \\\"https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames\\\",\\n  \\\"method\\\": \\\"POST\\\",\\n  \\\"headers\\\": {\\n    \\\"content-type\\\": \\\"application/json\\\",\\n    \\\"accept\\\": \\\"application/json\\\",\\n    \\\"username\\\": \\\"@Username@\\\",\\n    \\\"password\\\": \\\"@Password@\\\"\\n  },\\n  \\\"processData\\\": false,\\n  \\\"data\\\": body\\n}\\n\\n$.ajax(settings).done(function (response) {\\n  console.log(response);\\n});\",\n      \"language\": \"javascript\"\n    },\n    {\n      \"code\": \"<?php\\n\\n$username = \\\"@Username@\\\";\\n$password = \\\"@Password@\\\";\\n\\n$request = new HttpRequest();\\n$request->setUrl('https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames');\\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    \\\"Numbers\\\" : [{\\n        \\\"ImpersonateUserName\\\": \\\"ChildUser1\\\",\\n        \\\"Number\\\": \\\"447700900000\\\",\\n        \\\"IsInternational\\\": true\\n    },\\n    {\\n        \\\"ImpersonateUserName\\\": \\\"ChildUser2\\\",\\n        \\\"Number\\\": \\\"447979900000\\\",\\n        \\\"IsInternational\\\": false,\\n        \\\"RequiredCountryCode\\\": \\\"GBR\\\"\\n    }]\\n}');\\n\\ntry {\\n  $response = $request->send();\\n\\n  echo $response->getBody();\\n} catch (HttpException $ex) {\\n  echo $ex;\\n}\\n\",\n      \"language\": \"php\"\n    }\n  ]\n}\n[/block]","excerpt":"Validates one or more international or local phone numbers with billing applied to alternative accounts","slug":"rest-pnv-validatenumbersforusernames","type":"fn","title":"ValidateNumbersForUserNames"}

fnValidateNumbersForUserNames

Validates one or more international or local phone numbers with billing applied to alternative accounts

[block:callout] { "type": "info", "body": "To use this method you must be a reseller with child user accounts.", "title": "Note" } [/block] The ValidateNumbersForUserName method allows you to check check the validity of one or more phone numbers and whether the handset is currently on or off. You can also discover details about the network the phone number is on and whether the phone is outside its native country. [block:callout] { "type": "info", "title": "Performance Note", "body": "We recommended a maximum of 250 phone numbers are submitted in a single call to this method." } [/block] <div class="alert alert-success"><div class="label label-success">POST</div> &nbsp; **https://<span></span>services.dynmark.com/WebApi/PhoneNumberValidation/ValidateNumbersForUserNames**</div> ##Parameters Send requires an array of one or more Message objects. ##ValidateNumbersForUserRequest Object [block:parameters] { "data": { "h-0": "Property", "h-1": "Description", "0-0": "<code>Numbers<code>", "0-1": "An array of ValidateNumbersForUserNames objects" }, "cols": 2, "rows": 1 } [/block] ##ValidateNumbersForUserNames Object [block:parameters] { "data": { "1-0": "<code>Number</code><span class=\"c-danger\">*</span>", "1-1": "The phone number to validate. This can be in international or local format.", "1-2": "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)", "2-0": "<code>IsInternational</code>", "2-1": "If set to true, the supplied number is in international format.", "2-2": "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. 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", "3-2": "An optional country in ISO 3166-1 alpha-3 format. If specfied, the to field can contain a number in local format, e.g. GBR would allow 07123123456", "3-1": "Determines which international dialling code is prepended to the normalised number when normalising local format numbers. This parameter accepts country codes in [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) format.", "3-0": "<code>RequiredCountryCode</code>", "4-0": "**body**", "4-1": "string", "4-2": "The message text", "5-0": "deliverAfter", "6-0": "validiUntil", "7-0": "clientRef", "5-1": "DateTime", "5-2": "A date time specifying when we should try to deliver the message.", "6-2": "A date time specifying how long we should try to deliver the message for.", "6-1": "DateTime", "7-2": "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.", "7-1": "string", "8-0": "deliveryStatusUrl", "9-0": "filterSetName", "10-0": "rejectUnicode", "9-2": "If you have enabled Intelligent Filtering on your account, in the user portal, you can specify which filter set is applied to this message.", "10-2": "If set to true, any messages containing Unicode characters will not be sent.", "8-2": "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 Receipt handler documentation for more details", "h-0": "Property", "h-1": "Description", "h-2": "Description", "8-1": "string", "9-1": "string", "10-1": "boolean", "0-0": "<code>ImpersonateUserName</code><span class=\"c-danger\">*</span>", "0-1": "The name of the user to act as for the validation of this number. This user will be billed for the action and must belong to one of your child accounts." }, "cols": 2, "rows": 4 } [/block] ##Response The response is an array of ValidateNumberResponse objects [block:parameters] { "data": { "0-0": "<code>OriginalNumber</code><span class=\"c-danger\">*</span>", "0-1": "The phone number supplied in the request object.", "1-0": "<code>NumberStatus</code><span class=\"c-danger\">*</span>", "1-1": "The status of the phone number. This is one of the [NumberStatus](doc:number-status) integer values.", "2-0": "<code>NormalisedNumber</code>", "2-1": "The normalised number when supplying a localised number, e.g. 07770123456 is normalised to 447770123456.", "h-0": "Property", "h-1": "Description", "3-0": "<code>NetworkDetails</code>", "4-0": "<code>IMSI</code>", "4-1": "The [IMSI](https://en.wikipedia.org/wiki/International_mobile_subscriber_identity) associated with the number.", "3-1": "A [NetworkDetail](#section-networkdetail-object) element describing the network that the number belongs to." }, "cols": 2, "rows": 5 } [/block] ##NetworkDetail Object [block:parameters] { "data": { "0-0": "<code>NetworkName</code>", "1-0": "<code>NetworkPrefix</code>", "1-1": "The network prefix, e.g. 7770", "0-1": "The network name", "h-0": "Property", "h-1": "Description", "2-0": "<code>CountryName</code>", "2-1": "The country name.", "3-0": "<code>CountryCode</code>", "3-1": "A two digit country code in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format, e.g. GB", "4-0": "<code>CountryIDD</code>", "4-1": "The dialling code for the country, e.g. 44", "5-0": "<code>RoamingNetworkName</code>", "6-0": "<code>RoamingNetworkPrefix</code>", "7-0": "<code>RoamingCountryName</code>", "8-0": "<code>RoamingCountryCode</code>", "5-1": "If the phone is roaming, the name of the network being used to carry", "6-1": "If the phone is roaming, the network prefix, e.g. 7770. This will always be the same as the NetworkPrefix.", "7-1": "If the phone is roaming, the name of the country it was last seen in.", "8-1": "f the phone is roaming, the country code of the country it was last seen in [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) format.", "9-0": "<code>RoamingCountryIDD</code>", "9-1": "If the phone is roaming, the dialling code of the country it was last seen in.", "10-0": "<code>MCCMNC</code>", "10-1": "The mobile country code and mobile network code.", "11-0": "<code>IsPorted</code>", "11-1": "Flag indicating that the number has been ported from one network to another.", "12-0": "<code>PortedNetwork</code>", "12-1": "The network the phone was ported from." }, "cols": 2, "rows": 13 } [/block] ##Response Examples [block:code] { "codes": [ { "code": "[{\n\t\t\"OriginalNumber\" : \"447700900000\",\n\t\t\"NumberStatus\" : 2,\n\t\t\"NormalisedNumber\" : \"447700900000\",\n\t\t\"NetworkDetails\" : {\n\t\t\t\"NetworkName\" : \"T-Mobile UK Limited\",\n\t\t\t\"NetworkPrefix\" : \"7905\",\n\t\t\t\"CountryName\" : \"United Kingdom \",\n\t\t\t\"CountryCode\" : \"GB\",\n\t\t\t\"CountryIDD\" : \"44\",\n\t\t\t\"RoamingNetworkName\" : \"T-Mobile UK Limited\",\n\t\t\t\"RoamingNetworkPrefix\" : \"7953\",\n\t\t\t\"RoamingCountryName\" : \"United Kingdom \",\n\t\t\t\"RoamingCountryCode\" : \"GB\",\n\t\t\t\"RoamingCountryIDD\" : \"44\",\n\t\t\t\"MCCMNC\" : \"23430\",\n\t\t\t\"IsPorted\" : false,\n\t\t\t\"PortedNetwork\" : \"T-Mobile UK Limited\",\n\t\t\t\"CountryIsoCode\" : \"GBR\",\n\t\t\t\"RoamingCountryIsoCode\" : \"GBR\"\n\t\t},\n\t\t\"IMSI\" : 234307161073403\n\t}\n]", "language": "json", "name": "200 OK" }, { "code": "{\n \"ErrorDetail\":\"Invalid request data was supplied. Please check that your format of your request matches the API documentation.\",\n \"ErrorType\":\"String\"\n}", "language": "json", "name": "400 Bad Request" }, { "code": "No authorization header supplied or invalid username or password", "language": "text", "name": "401 Unauthorized" } ] } [/block] ##Examples [block:code] { "codes": [ { "code": "string username = \"@Username@\";\nstring password = \"@Password@\";\n\nvar body = new\n{\n Numbers = new[]\n {\n new\n {\n \"ImpersonateUserName\": \"ChildAccountUser1\",\n \"Number\": \"447700900000\",\n \"IsInternational\": true,\n },\n new\n {\n \"ImpersonateUserName\": \"ChildAccountUser2\",\n \"Number\": \"07700900001\",\n \"IsInternational\": false,\n \"CountryIsoCode\": \"GBR\"\n }\n }\n};\n\nvar client = new RestClient(\"https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames\");\nclient.Authenticator = new HttpBasicAuthenticator(username, password);\nclient.Timeout = 130000;\n\nvar request = new RestRequest();\nrequest.AddJsonBody(body);\nIRestResponse response = client.Post(request);", "language": "csharp" }, { "code": "curl -X POST -H \"Content-Type: application/json\" -H \"Accept: application/json\" -user @Username@:@Password@ -d '{\n \"Numbers\" : [{\n \"ImpersonateUserName\": \"ChildUser1\",\n \"Number\": \"447700900000\",\n \"IsInternational\": true\n },\n {\n \"ImpersonateUserName\": \"ChildUser2\",\n \"Number\": \"447979900000\",\n \"IsInternational\": false,\n \"RequiredCountryCode\": \"GBR\"\n }]\n}\n' 'https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames'", "language": "curl" }, { "code": "String username = \"@Username@\";\nString password = \"@Password@\";\n\nHttpResponse<String> response = Unirest.post(\"https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames\")\n .header(\"content-type\", \"application/json\")\n .header(\"accept\", \"application/json\")\n .basicAuth(username, password)\n .body(\"{\\n \\\"Numbers\\\" : [{\\n \\\"ImpersonateUserName\\\": \\\"ChildUser1\\\", \\\"Number\\\": \\\"447700900000\\\",\\n \\\"IsInternational\\\": true\\n },\\n {\\n \\\"ImpersonateUserName\\\": \\\"ChildUser2\\\", \\\"Number\\\": \\\"447979900000\\\",\\n \\\"IsInternational\\\": false,\\n \\\"RequiredCountryCode\\\": \\\"GBR\\\"\\n }]\\n}\\n\")\n .asString();", "language": "java" }, { "code": "var body = {\n \"Numbers\" : [{\n \"ImpersonateUserName\": \"ChildUser1\",\n \"Number\": \"447700900000\",\n \"IsInternational\": true\n },\n {\n \"ImpersonateUserName\": \"ChildUser2\",\n \"Number\": \"447979900000\",\n \"IsInternational\": false,\n \"RequiredCountryCode\": \"GBR\"\n }]\n};\n\nvar settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames\",\n \"method\": \"POST\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"accept\": \"application/json\",\n \"username\": \"@Username@\",\n \"password\": \"@Password@\"\n },\n \"processData\": false,\n \"data\": body\n}\n\n$.ajax(settings).done(function (response) {\n console.log(response);\n});", "language": "javascript" }, { "code": "<?php\n\n$username = \"@Username@\";\n$password = \"@Password@\";\n\n$request = new HttpRequest();\n$request->setUrl('https://services.dynmark.com/webapi/phonenumbervalidation/validatenumbersforusernames');\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 \"Numbers\" : [{\n \"ImpersonateUserName\": \"ChildUser1\",\n \"Number\": \"447700900000\",\n \"IsInternational\": true\n },\n {\n \"ImpersonateUserName\": \"ChildUser2\",\n \"Number\": \"447979900000\",\n \"IsInternational\": false,\n \"RequiredCountryCode\": \"GBR\"\n }]\n}');\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}\n", "language": "php" } ] } [/block]