{"_id":"56bb05b7fb70442b003683ee","__v":0,"editedParams2":true,"editedParams":true,"project":"568fce2a04440a1700e4cb47","user":"55116f88e2990b0d00fb0552","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"},"parentDoc":null,"category":{"_id":"5694c4cd1005590d0062cb25","pages":["569f8c611082520d005c703a","569fa534a454d2230002cb72","569fa79197472b1700201634","569fb65c27af53210043231d","569fb6931082520d005c7085","56a0a29cd847b50d00a275f0","56a0ae0ac29eb50d00e33e05","56b9e47cb77e261700bc1425","56bb05b7fb70442b003683ee","56bb06ec959bd90d00afb0a2","56d41bbed3f4650b007496df"],"version":"568fce2b04440a1700e4cb4a","__v":11,"project":"568fce2a04440a1700e4cb47","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-01-12T09:18:05.741Z","from_sync":false,"order":5,"slug":"rest-services","title":"REST API"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2016-02-10T09:41:11.624Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"examples":{"codes":[{"language":"csharp","name":null,"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"},{"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"},{"language":"javascript","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":"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},{"language":"json","status":400,"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]"},{"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":10,"body":"The Verify Code method allows you to check the status of a verification code generated by the [Send Code](doc:rest-verify-create) method.\n\n<div class=\"alert alert-success\"><div class=\"label label-success\">PUT</div> &nbsp; **https://<span></span>services.dynmark.com/WebApi/Verify/*{requestId}*/validate**</div>\n\n##Parameters\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"<code>requestId</code><span class=\\\"c-danger\\\">*</span>\",\n    \"0-1\": \"string\",\n    \"0-2\": \"The verify request id returned from [Send Code](doc:rest-messaging-sendcode)\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n##Body\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"<code>code</code><span class=\\\"c-danger\\\">*</span>\",\n    \"0-1\": \"string\",\n    \"0-2\": \"A string containing the verification code to check\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\"\n  },\n  \"cols\": 3,\n  \"rows\": 1\n}\n[/block]\n##Response\nThe response format varies depending on the HTTP status code.\n\n###RequestId was recognised\nAn HTTP 200 OK is returned with the body of the response containing a VerifyCode object which contains a status property that describes whether the code validated successfully, and if not, the reason why.\n[block:parameters]\n{\n  \"data\": {\n    \"2-0\": \"<code>status</code><span class=\\\"c-danger\\\">*</span>\",\n    \"2-1\": \"The status of the code. This can be one of the following:\\n* CodeVerified - The code was correct\\n* CodeNotVerified - The code was not correct\\n* CodeLocked - The code has been locked due to too many unsuccessful attempts to validate.\\n* CodeExpired - The code has expired\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"<code>requestId</code><span class=\\\"c-danger\\\">*</span>\",\n    \"1-0\": \"<code>phoneNumber</code><span class=\\\"c-danger\\\">*</span>\",\n    \"3-0\": \"<code>numberStatus</code><span class=\\\"c-danger\\\">*</span>\",\n    \"3-1\": \"The status of the phone number at the time the code was sent to it.\",\n    \"5-0\": \"<code>verified</code>\",\n    \"5-1\": \"The date the code was verified. This is a UTC time in ISO 8601 format, e.g. 2015-10-21T13:28:06.419Z\",\n    \"4-0\": \"<code>created</code><span class=\\\"c-danger\\\">*</span>\",\n    \"4-1\": \"The date the code was sent to the phone. This is a UTC time in ISO 8601 format, e.g. 2015-10-21T13:28:06.419Z\",\n    \"0-1\": \"A globally unique identifier for the verify request. This is used to refer to the request in calls\",\n    \"1-1\": \"The phone number the code was sent to in international format\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]\n###RequestId was not recognised\nAn HTTP status of 204 No Content is returned\n\n###Invalid parameters were supplied\nIf there is a problem with the parameters passed to the method, a 400 Bad Request HTTP status is returned and the body of the response is an array of ValidationFailure objects.\n\n##ValidationFailure Object\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"<code>property<code>\",\n    \"1-0\": \"<code>failureCode</code><span class=\\\"c-danger\\\">*</span>\",\n    \"2-0\": \"<code>details</code><span class=\\\"c-danger\\\">*</span>\",\n    \"2-1\": \"A human readable description of the validation failure.\",\n    \"1-1\": \"A string containing a short machine readable failure code. See [Error Codes](doc:rest-verify-error-codes) for more details.\",\n    \"0-1\": \"The property that the validation failure applies to, or empty if the failure applies to the entire submitted payload.\",\n    \"h-0\": \"Property\",\n    \"h-1\": \"Description\"\n  },\n  \"cols\": 2,\n  \"rows\": 3\n}\n[/block]\n##Response Examples\n###Validate a matching code\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET -H \\\"Content-Type: application/json\\\" -user #USER#:#PASSWORD# -d '{\\n    \\\"code\\\": \\\"12345\\\"\\n}' 'https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate'\",\n      \"language\": \"curl\",\n      \"name\": \" \"\n    }\n  ]\n}\n[/block]\n####Response - Code was verified\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"status\\\": \\\"CodeVerified\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK\"\n    }\n  ]\n}\n[/block]\n####Response - Code was not recognised\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"status\\\": \\\"CodeNotVerified\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"200 OK\"\n    }\n  ]\n}\n[/block]\n####Response - Request Id not recognised\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"\",\n      \"language\": \"text\",\n      \"name\": \"204 No Content\"\n    }\n  ]\n}\n[/block]\n###No code supplied\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET -H \\\"Content-Type: application/json\\\" -user #USER#:#PASSWORD# -d '{\\n    \\\"code\\\": \\\"\\\"\\n}' 'https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate'\",\n      \"language\": \"curl\",\n      \"name\": \" \"\n    }\n  ]\n}\n[/block]\n####Response\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"[\\n  {\\n    \\\"property\\\": \\\"verifyCode\\\",\\n    \\\"failureCode\\\": \\\"CodeEmpty\\\",\\n    \\\"details\\\": \\\"verifyCode cannot be null or empty\\\"\\n  }\\n]\",\n      \"language\": \"json\",\n      \"name\": \"400 Bad Request\"\n    }\n  ]\n}\n[/block]\n###Request without an authorization header\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"curl -X GET -H \\\"Content-Type: application/json\\\" -d '{\\n    \\\"code\\\": \\\"12345\\\"\\n}' 'https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate'\",\n      \"language\": \"curl\",\n      \"name\": \" \"\n    }\n  ]\n}\n[/block]\n####Response\n[block:code]\n{\n  \"codes\": [\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##Language Examples\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"Guid requestId = new Guid(\\\"0D5C94D4-DF1F-4FC8-82D2-1F64EA548704\\\");\\nvar body = new\\n{\\n  code = \\\"12345\\\"\\n};\\n\\n// Use RestSharp to call API\\nvar client = new RestClient(string.Format(\\\"https://services.dynmark.com/webapi/verify/{0}/validate\\\", requestId);\\nclient.Authenticator = new HttpBasicAuthenticator(userName, password);\\n\\nvar request = new RestRequest();\\nrequest.AddJsonBody(body);\\nIRestResponse response = client.Post(request);\",\n      \"language\": \"csharp\"\n    },\n    {\n      \"code\": \"curl -X GET -H \\\"Content-Type: application/json\\\" -user #USER#:#PASSWORD# \\n}' 'https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate'\",\n      \"language\": \"curl\"\n    },\n    {\n      \"code\": \"string username = \\\"#USERNAME#\\\";\\nstring password = \\\"#PASSWORD#\\\";\\n\\nHttpResponse<String> response = Unirest.get(\\\"https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate\\\")\\n  .header(\\\"content-type\\\", \\\"application/json\\\")\\n  .basicAuth(username, password)\\n  .asString();\",\n      \"language\": \"java\"\n    },\n    {\n      \"code\": \"var settings = {\\n  \\\"async\\\": true,\\n  \\\"crossDomain\\\": true,\\n  \\\"url\\\": \\\"https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate\\\",\\n  \\\"method\\\": \\\"GET\\\",\\n  \\\"headers\\\": {\\n    \\\"content-type\\\": \\\"application/json\\\",\\n    \\\"username\\\": \\\"#USERNAME#\\\",\\n    \\\"password\\\": \\\"#PASSWORD#\\\",\\n  },\\n  \\\"processData\\\": false\\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/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate');\\n$request->setMethod(HTTP_METH_GET);\\n\\n$request->setHeaders(array(\\n  'authorization' => 'Basic ' . base64_encode(\\\"$username:$password\\\")\\n  'content-type' => 'application/json'\\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":"Check whether a verification code is valid.","slug":"rest-verify-validate","type":"fn","title":"Validate"}

Validate

Check whether a verification code is valid.

The Verify Code method allows you to check the status of a verification code generated by the [Send Code](doc:rest-verify-create) method. <div class="alert alert-success"><div class="label label-success">PUT</div> &nbsp; **https://<span></span>services.dynmark.com/WebApi/Verify/*{requestId}*/validate**</div> ##Parameters [block:parameters] { "data": { "0-0": "<code>requestId</code><span class=\"c-danger\">*</span>", "0-1": "string", "0-2": "The verify request id returned from [Send Code](doc:rest-messaging-sendcode)", "h-0": "Property", "h-1": "Type", "h-2": "Description" }, "cols": 3, "rows": 1 } [/block] ##Body [block:parameters] { "data": { "0-0": "<code>code</code><span class=\"c-danger\">*</span>", "0-1": "string", "0-2": "A string containing the verification code to check", "h-0": "Property", "h-1": "Type", "h-2": "Description" }, "cols": 3, "rows": 1 } [/block] ##Response The response format varies depending on the HTTP status code. ###RequestId was recognised An HTTP 200 OK is returned with the body of the response containing a VerifyCode object which contains a status property that describes whether the code validated successfully, and if not, the reason why. [block:parameters] { "data": { "2-0": "<code>status</code><span class=\"c-danger\">*</span>", "2-1": "The status of the code. This can be one of the following:\n* CodeVerified - The code was correct\n* CodeNotVerified - The code was not correct\n* CodeLocked - The code has been locked due to too many unsuccessful attempts to validate.\n* CodeExpired - The code has expired", "h-0": "Property", "h-1": "Description", "0-0": "<code>requestId</code><span class=\"c-danger\">*</span>", "1-0": "<code>phoneNumber</code><span class=\"c-danger\">*</span>", "3-0": "<code>numberStatus</code><span class=\"c-danger\">*</span>", "3-1": "The status of the phone number at the time the code was sent to it.", "5-0": "<code>verified</code>", "5-1": "The date the code was verified. This is a UTC time in ISO 8601 format, e.g. 2015-10-21T13:28:06.419Z", "4-0": "<code>created</code><span class=\"c-danger\">*</span>", "4-1": "The date the code was sent to the phone. This is a UTC time in ISO 8601 format, e.g. 2015-10-21T13:28:06.419Z", "0-1": "A globally unique identifier for the verify request. This is used to refer to the request in calls", "1-1": "The phone number the code was sent to in international format" }, "cols": 2, "rows": 6 } [/block] ###RequestId was not recognised An HTTP status of 204 No Content is returned ###Invalid parameters were supplied If there is a problem with the parameters passed to the method, a 400 Bad Request HTTP status is returned and the body of the response is an array of ValidationFailure objects. ##ValidationFailure Object [block:parameters] { "data": { "0-0": "<code>property<code>", "1-0": "<code>failureCode</code><span class=\"c-danger\">*</span>", "2-0": "<code>details</code><span class=\"c-danger\">*</span>", "2-1": "A human readable description of the validation failure.", "1-1": "A string containing a short machine readable failure code. See [Error Codes](doc:rest-verify-error-codes) for more details.", "0-1": "The property that the validation failure applies to, or empty if the failure applies to the entire submitted payload.", "h-0": "Property", "h-1": "Description" }, "cols": 2, "rows": 3 } [/block] ##Response Examples ###Validate a matching code [block:code] { "codes": [ { "code": "curl -X GET -H \"Content-Type: application/json\" -user #USER#:#PASSWORD# -d '{\n \"code\": \"12345\"\n}' 'https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate'", "language": "curl", "name": " " } ] } [/block] ####Response - Code was verified [block:code] { "codes": [ { "code": "{\n \"status\": \"CodeVerified\"\n}", "language": "json", "name": "200 OK" } ] } [/block] ####Response - Code was not recognised [block:code] { "codes": [ { "code": "{\n \"status\": \"CodeNotVerified\"\n}", "language": "json", "name": "200 OK" } ] } [/block] ####Response - Request Id not recognised [block:code] { "codes": [ { "code": "", "language": "text", "name": "204 No Content" } ] } [/block] ###No code supplied [block:code] { "codes": [ { "code": "curl -X GET -H \"Content-Type: application/json\" -user #USER#:#PASSWORD# -d '{\n \"code\": \"\"\n}' 'https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate'", "language": "curl", "name": " " } ] } [/block] ####Response [block:code] { "codes": [ { "code": "[\n {\n \"property\": \"verifyCode\",\n \"failureCode\": \"CodeEmpty\",\n \"details\": \"verifyCode cannot be null or empty\"\n }\n]", "language": "json", "name": "400 Bad Request" } ] } [/block] ###Request without an authorization header [block:code] { "codes": [ { "code": "curl -X GET -H \"Content-Type: application/json\" -d '{\n \"code\": \"12345\"\n}' 'https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate'", "language": "curl", "name": " " } ] } [/block] ####Response [block:code] { "codes": [ { "code": "No authorization header supplied or invalid username or password", "language": "text", "name": "401 Unauthorized" } ] } [/block] ##Language Examples [block:code] { "codes": [ { "code": "Guid requestId = new Guid(\"0D5C94D4-DF1F-4FC8-82D2-1F64EA548704\");\nvar body = new\n{\n code = \"12345\"\n};\n\n// Use RestSharp to call API\nvar client = new RestClient(string.Format(\"https://services.dynmark.com/webapi/verify/{0}/validate\", requestId);\nclient.Authenticator = new HttpBasicAuthenticator(userName, password);\n\nvar request = new RestRequest();\nrequest.AddJsonBody(body);\nIRestResponse response = client.Post(request);", "language": "csharp" }, { "code": "curl -X GET -H \"Content-Type: application/json\" -user #USER#:#PASSWORD# \n}' 'https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate'", "language": "curl" }, { "code": "string username = \"#USERNAME#\";\nstring password = \"#PASSWORD#\";\n\nHttpResponse<String> response = Unirest.get(\"https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate\")\n .header(\"content-type\", \"application/json\")\n .basicAuth(username, password)\n .asString();", "language": "java" }, { "code": "var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://services.dynmark.com/webapi/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate\",\n \"method\": \"GET\",\n \"headers\": {\n \"content-type\": \"application/json\",\n \"username\": \"#USERNAME#\",\n \"password\": \"#PASSWORD#\",\n },\n \"processData\": false\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/verify/55569B50-785F-4865-9769-ED1E21CF6A88/validate');\n$request->setMethod(HTTP_METH_GET);\n\n$request->setHeaders(array(\n 'authorization' => 'Basic ' . base64_encode(\"$username:$password\")\n 'content-type' => 'application/json'\n));\n\ntry {\n $response = $request->send();\n\n echo $response->getBody();\n} catch (HttpException $ex) {\n echo $ex;\n}\n", "language": "php" } ] } [/block]