{"_id":"55cba6d437edd823001a85e0","category":{"_id":"55cba6d337edd823001a85da","__v":1,"pages":["55cba6d437edd823001a85e0","55cba6d437edd823001a85e1","55cba6d437edd823001a85e2","55cba6d437edd823001a85e3","55cba6d437edd823001a85e4","55cba6d437edd823001a85e5"],"project":"55c80e130300460d00c91c1d","version":"55cba6d237edd823001a85d7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-11T19:40:06.209Z","from_sync":false,"order":2,"slug":"lead-validation-end-api","title":"LEAD VALIDATION END API"},"editedParams":true,"parentDoc":null,"project":"55c80e130300460d00c91c1d","user":"55ca76068705a70d00b8fbef","__v":2,"editedParams2":true,"version":{"_id":"55cba6d237edd823001a85d7","project":"55c80e130300460d00c91c1d","__v":3,"createdAt":"2015-08-12T20:04:34.776Z","releaseDate":"2015-08-12T20:04:34.776Z","categories":["55cba6d337edd823001a85d8","55cba6d337edd823001a85d9","55cba6d337edd823001a85da","55cba6d337edd823001a85db","55cbd8e84cf2180d00bb1c15","561312bc41a9ec0d00a3fdfc"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2"},"updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-08-12T17:39:29.159Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","examples":{"codes":[{"name":"","code":"<?php\n    \n$licensekey = \"YOURKEYHERE\";\n\n$url =  \"https://api.accurateappend.com/Services/V2/ValidateName/\" . $licensekey . \"/?\";\n$querystring = \"name=\" . urlencode(\"john a & robin d smith\");\n\n\n$url .= $querystring;\n//echo \"request url: \" . $url . \"<br>\\n<br>\\n\";\n\nif(strtoupper(substr(PHP_OS, 0, 3)) === 'WIN')\n{\n    // windows operating system as the requesting server\n    $cacert_path_file = dirname(__FILE__) . \"\\cacert.pem\";\n}\nelse\n{\n    // other os\n    $cacert_path_file = \"cacert.pem\";\n}\n\n$ch = curl_init();\ncurl_setopt($ch, CURLOPT_URL, $url);\ncurl_setopt($ch, CURLOPT_HTTPGET, true);\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));\ncurl_setopt($ch, CURLOPT_SSLVERSION, 'CURL_SSLVERSION_DEFAULT');  // on a windows server the single quotes are required on 3rd parameter\ncurl_setopt($ch, CURLOPT_CAINFO, $cacert_path_file);\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\ncurl_setopt($ch, CURLOPT_VERBOSE, true);\n\n$json_string = curl_exec($ch);\n$curl_err = curl_error($ch);\n\nif($curl_err)\n{\n    echo \"curl error: $curl_err\";\n}\nelse\n{\n    curl_close($ch);\n\n    // decode json\n    $parsed_json = json_decode($json_string);\n\n    // instantiate an associative array\n    $response = array();\n    // load json data into associative array\n    $response = json_to_associative($parsed_json);\n\n    // print the associative array to the screen\n    foreach ($response as $key => $value)\n    {\n        echo $key . \" = \" . $value . \"<br>\\n\";\n    }\n}\n\n\necho \"<br>\\n\";\necho \"<br>\\n\";\necho \"<br>\\n\";\necho \"<br>\\n\";\necho \"<br>\\n\";\necho \"<br>\\n\";\necho \"<br>\\n\";\n\n\n\n// --------------------------------------------------------- //\n//\n// --------------------------------------------------------- //\nfunction json_to_associative($parsed_json)\n{\n    $response = array();\n\n    // load the associative array with all response key/value pairs\n    $response['Host'] = $parsed_json->{'Criteria'}->Host;\n    $response['RequestDate'] = $parsed_json->{'Criteria'}->RequestDate;\n    $response['RequestIP'] = $parsed_json->{'Criteria'}->RequestIP;\n    $response['TransactionId'] = $parsed_json->{'Criteria'}->TransactionId;\n    $response['Name'] = $parsed_json->{'Criteria'}->Name;\n\n\n    // typecast the stdClass to array\n    $obj_arr = (array)$parsed_json->{'NameResult'};\n\n    if(!empty($obj_arr))\n    {\n        $response['FirstName1'] = $obj_arr['FirstName1'];\n\n        // a conditional added here because some people do not have a middle name and also if nobody is found\n        if(array_key_exists(\"MiddleName1\", $obj_arr))\n        {\n            $response['MiddleName1'] = $obj_arr['MiddleName1'];\n        }\n\n        $response['LastName1'] = $obj_arr['LastName1'];\n        $response['Gender1'] = $obj_arr['Gender1'];\n\n\n        // because it is likely possible that only one person's name is returned add conditionals for these keys\n        if(array_key_exists(\"FirstName2\", $obj_arr))\n        {\n            $response['FirstName2'] = $obj_arr['FirstName2'];\n        }\n        if(array_key_exists(\"MiddleName2\", $obj_arr))\n        {\n            $response['MiddleName2'] = $obj_arr['MiddleName2'];\n        }\n        if(array_key_exists(\"LastName2\", $obj_arr))\n        {\n            $response['LastName2'] = $obj_arr['LastName2'];\n        }\n        if(array_key_exists(\"Gender2\", $obj_arr))\n        {\n            $response['Gender2'] = $obj_arr['Gender2'];\n        }\n\n\n        // iteration required for mulitple Phones response\n        for($i = 0; $i < count($parsed_json->{'NameResult'}->{'Codes'}); $i++)\n        {\n\n            $keynum = $i + 1;\n\n            $response['Code' . $keynum] = $parsed_json->{'NameResult'}->{'Codes'}[$i]->Code;\n            $response['Description' . $keynum] = $parsed_json->{'NameResult'}->{'Codes'}[$i]->Description;\n            $response['Status' . $keynum] = $parsed_json->{'NameResult'}->{'Codes'}[$i]->Status;\n        }\n    }\n    return $response;\n}\n\n/*\nCopyright (c) 2015, AccurateAppend Corp\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted \nprovided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions \n   and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions \n   and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse \n   or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR \nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS \nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR \nTORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF \nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n\n?>","language":"php"},{"code":"using System;\nusing System.Collections.Generic;\nusing System.Net;\nusing RestSharp;\n\nnamespace Samples\n{\n    // This example uses the RestSharp NuGet package (https://www.nuget.org/packages/RestSharp)\n  \n    public static class Program\n    {\n        private const String Key = \"YOURKEYHERE\";\n        private const String RootUri = :::at:::\"http://api.accurateappend.com/Services/V2\";\n\n        public static void Main(String[] args)\n        {\n            ValidateName();\n        }\n\n        #region Validation\n\n        public class Result\n        {\n            public String Type { get; set; }\n\n            public String Status { get; set; }\n\n            public String Code { get; set; }\n\n            public String Description { get; set; }\n        }\n\n        #region Validate Name\n\n        private static void ValidateName()\n        {\n            const String Resource =\n                \"/ValidateName/\" + Key +\n                \"/?name=john%20a%20&%20robin%20d%20smith\"; //note that name is url encoded \"john a & robin d smith\"\n\n            var request = new RestRequest(Resource) { Method = Method.GET };\n\n            var client = new RestClient(RootUri);\n            var response = client.Execute<NameResult>(request);\n            if (response.StatusCode != HttpStatusCode.OK)\n            {\n                // Error Handling Omitted For Brevity\n            }\n            var data = response.Data;\n            Console.WriteLine(\"{0} {1}, {2}\", data.FirstName1, data.LastName1, data.Gender1);\n        }\n\n        public class NameResponse\n        {\n            public NameResult NameResult { get; set; }\n        }\n\n        public class NameResult\n        {\n            public String FirstName1 { get; set; }\n\n            public String MiddleName1 { get; set; }\n\n            public String LastName1 { get; set; }\n\n            public String Gender1 { get; set; }\n\n            public String FirstName2 { get; set; }\n\n            public String MiddleName2 { get; set; }\n\n            public String LastName2 { get; set; }\n\n            public String Gender2 { get; set; }\n\n            public List<Result> Results { get; set; }\n        }\n\n        #endregion\n    }\n\n}\n\n/*\nCopyright (c) 2015, AccurateAppend Corp\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without modification, are permitted \nprovided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions \n   and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions \n   and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse \n   or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR \nIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND \nFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS \nBE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \nBUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR \nTORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF \nADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/","language":"csharp"}]},"method":"get","results":{"codes":[{"name":"","status":200,"language":"json","code":"{\n     \"Criteria\": {\n          \"Host\": \"XXXX\",\n           \"RequestDate\": \"2015-08-12T21:53:53.3070563Z\",\n           \"RequestIP\": \"192:168:1:1\",\n           \"TransactionId\": \"fdd61fac-6ee3-46d2-8b16-54712efdca71\",\n           \"Name\": \"john a & robin d smith\" }\n,\n      \"NameResult\": {\n          \"Codes\": [\n               {\n                    \"Code\": \"N1\",\n                     \"Description\": \"Parsing successful\",\n                     \"Status\": \"Status\" }\n          ,\n                {\n                    \"Code\": \"N5\",\n                     \"Description\": \"FirstName1 was found in the first name lookup database\",\n                     \"Status\": \"Status\" }\n          ,\n                {\n                    \"Code\": \"N6\",\n                     \"Description\": \"LastName1 was found in the last name lookup database\",\n                     \"Status\": \"Status\" }\n          ,\n                {\n                    \"Code\": \"N7\",\n                     \"Description\": \"FirstName2 was found in the first name lookup database\",\n                     \"Status\": \"Status\" }\n          ,\n                {\n                    \"Code\": \"N8\",\n                     \"Description\": \"LastName2 was found in the last name lookup database\",\n                     \"Status\": \"Status\" }\n           ]\n     ,\n           \"FirstName1\": \"John\",\n           \"FirstName2\": \"Robin\",\n           \"Gender1\": \"M\",\n           \"Gender2\": \"N\",\n           \"LastName1\": \"Smith\",\n           \"LastName2\": \"Smith\" }\n}"}]},"auth":"required","params":[{"_id":"55cbc1204153080d004468fd","ref":"","in":"path","required":true,"desc":"License key issued by customer support.","default":"","type":"string","name":"licensekey"},{"_id":"55cbc1204153080d004468fc","ref":"","in":"query","required":true,"desc":"Search subject's full name. Can be formatted as FIRST + LAST or FIRST + MIDDLE + LAST or LAST, FIRST + MIDDLE","default":"","type":"string","name":"name"}],"url":"/ValidateName/:licensekey/?"},"isReference":false,"order":0,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"HTTP Headers\",\n  \"body\": \"When making a call to this API, the HTTP header \\\"content-type\\\" MUST be supplied with a value of \\\"application/json\\\". Failure to include this header will result in an HTTP 400 Bad Request response. Your choice of client library may automatically include this header. Please consult your documentation.\"\n}\n[/block]\n## NameResult\nIf request contains two names then two separate sets of names and gender are returned.\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Field name\",\n    \"h-1\": \"Type\",\n    \"h-2\": \"Description\",\n    \"0-0\": \"FirstName1\",\n    \"0-2\": \"Parsed first name\",\n    \"0-1\": \"string\",\n    \"1-2\": \"Parsed middle name\",\n    \"1-0\": \"MiddleName1\",\n    \"1-1\": \"string\",\n    \"2-0\": \"LastName1\",\n    \"2-1\": \"string\",\n    \"2-2\": \"Parsed last name\",\n    \"3-0\": \"FirstName2\",\n    \"3-2\": \"Parsed first name\",\n    \"3-1\": \"string\",\n    \"4-1\": \"string\",\n    \"5-1\": \"string\",\n    \"4-0\": \"MiddleName2\",\n    \"5-0\": \"LastName2\",\n    \"4-2\": \"Parsed middle name\",\n    \"5-2\": \"Parsed last name\",\n    \"6-2\": \"Parsing and validation results. See Status codes.\",\n    \"6-1\": \"array\",\n    \"6-0\": \"Codes\"\n  },\n  \"cols\": 3,\n  \"rows\": 7\n}\n[/block]\n## Name Status Codes\nThis section lists the following types of status codes for the ValidateName method\n\n## Status Codes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"N1\",\n    \"0-1\": \"Parsing successful\",\n    \"1-0\": \"N2\",\n    \"1-1\": \"Parsing error\",\n    \"2-0\": \"N3\",\n    \"2-1\": \"FirstName1 had its spelling corrected\",\n    \"3-0\": \"N4\",\n    \"3-1\": \"FirstName2 had its spelling corrected\",\n    \"4-0\": \"N5\",\n    \"4-1\": \"FirstName1 was found in the first name lookup table\",\n    \"5-0\": \"N6\",\n    \"5-1\": \"LastName1 was found in the last name lookup database\",\n    \"6-0\": \"N7\",\n    \"6-1\": \"FirstName2 was found in the first name lookup database\",\n    \"7-0\": \"N8\",\n    \"7-1\": \"LastName2 was found in the last name lookup database\"\n  },\n  \"cols\": 2,\n  \"rows\": 8\n}\n[/block]\n## Error Codes\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Code\",\n    \"h-1\": \"Description\",\n    \"0-0\": \"N9\",\n    \"0-1\": \"Unrecognized name format\",\n    \"1-0\": \"N10\",\n    \"1-1\": \"Multiple first names detected\",\n    \"2-0\": \"N11\",\n    \"2-1\": \"Vulgarity detected\",\n    \"3-0\": \"N12\",\n    \"3-1\": \"Suspicious word detected\",\n    \"4-0\": \"N13\",\n    \"4-1\": \"Business name detected\",\n    \"5-0\": \"N14\",\n    \"5-1\": \"Non-alphabetic character detected\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]\n## Error Messages\nFor a list of codes and descriptions click [here](http://docs.accurateappend.com/docs/error-messages).","excerpt":"This section describes request parameters, responses and potential error messages for the ValidateName method.\n\nParses single input string containing up to two full names into their individual first name, middle name, and last name components.\n\nAppends gender to each name set returned.\n- Identifies business names.\n- Identifies nuisance names.\n- Identifies profanity.\n- Detects multiple first names and multiple last names.\n- Verifies commonality of first name and last name.","slug":"validatename","type":"endpoint","title":"Validate Name"}

getValidate Name

This section describes request parameters, responses and potential error messages for the ValidateName method. Parses single input string containing up to two full names into their individual first name, middle name, and last name components. Appends gender to each name set returned. - Identifies business names. - Identifies nuisance names. - Identifies profanity. - Detects multiple first names and multiple last names. - Verifies commonality of first name and last name.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

licensekey:
required
string
License key issued by customer support.

Query Params

name:
required
string
Search subject's full name. Can be formatted as FIRST + LAST or FIRST + MIDDLE + LAST or LAST, FIRST + MIDDLE

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "HTTP Headers", "body": "When making a call to this API, the HTTP header \"content-type\" MUST be supplied with a value of \"application/json\". Failure to include this header will result in an HTTP 400 Bad Request response. Your choice of client library may automatically include this header. Please consult your documentation." } [/block] ## NameResult If request contains two names then two separate sets of names and gender are returned. [block:parameters] { "data": { "h-0": "Field name", "h-1": "Type", "h-2": "Description", "0-0": "FirstName1", "0-2": "Parsed first name", "0-1": "string", "1-2": "Parsed middle name", "1-0": "MiddleName1", "1-1": "string", "2-0": "LastName1", "2-1": "string", "2-2": "Parsed last name", "3-0": "FirstName2", "3-2": "Parsed first name", "3-1": "string", "4-1": "string", "5-1": "string", "4-0": "MiddleName2", "5-0": "LastName2", "4-2": "Parsed middle name", "5-2": "Parsed last name", "6-2": "Parsing and validation results. See Status codes.", "6-1": "array", "6-0": "Codes" }, "cols": 3, "rows": 7 } [/block] ## Name Status Codes This section lists the following types of status codes for the ValidateName method ## Status Codes [block:parameters] { "data": { "h-0": "Code", "h-1": "Description", "0-0": "N1", "0-1": "Parsing successful", "1-0": "N2", "1-1": "Parsing error", "2-0": "N3", "2-1": "FirstName1 had its spelling corrected", "3-0": "N4", "3-1": "FirstName2 had its spelling corrected", "4-0": "N5", "4-1": "FirstName1 was found in the first name lookup table", "5-0": "N6", "5-1": "LastName1 was found in the last name lookup database", "6-0": "N7", "6-1": "FirstName2 was found in the first name lookup database", "7-0": "N8", "7-1": "LastName2 was found in the last name lookup database" }, "cols": 2, "rows": 8 } [/block] ## Error Codes [block:parameters] { "data": { "h-0": "Code", "h-1": "Description", "0-0": "N9", "0-1": "Unrecognized name format", "1-0": "N10", "1-1": "Multiple first names detected", "2-0": "N11", "2-1": "Vulgarity detected", "3-0": "N12", "3-1": "Suspicious word detected", "4-0": "N13", "4-1": "Business name detected", "5-0": "N14", "5-1": "Non-alphabetic character detected" }, "cols": 2, "rows": 6 } [/block] ## Error Messages For a list of codes and descriptions click [here](http://docs.accurateappend.com/docs/error-messages).

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}