{"_id":"55cbbab850046e3700d91055","editedParams":true,"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"},"user":"55ca76068705a70d00b8fbef","parentDoc":null,"__v":0,"category":{"_id":"55cba6d337edd823001a85db","pages":["55cba6d337edd823001a85dc","55cba6d337edd823001a85dd","55cba6d337edd823001a85de","55cba6d337edd823001a85df"],"project":"55c80e130300460d00c91c1d","version":"55cba6d237edd823001a85d7","__v":1,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2015-08-10T13:42:49.644Z","from_sync":false,"order":4,"slug":"definitions","title":"DEFINITIONS"},"project":"55c80e130300460d00c91c1d","updates":[],"next":{"pages":[],"description":""},"createdAt":"2015-08-12T21:29:28.050Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[{"name":"","code":"{  \n   \"Criteria\":{  \n      \"Host\":\"C2N2\",\n      \"RequestDate\":\"2015-07-14T15:31:51.3449564Z\",\n      \"RequestIP\":\"::1\",\n      \"TransactionId\":\"e5be8f0e-a6ee-46b0-bd9b-e2450efbb70e\",\n      \"Address\":\"123 Main St\",\n      \"City\":\"Seattle\",\n      \"FirstName\":\"John\",\n      \"LastName\":\"Smith\",\n      \"PostalCode\":\"98101\",\n      \"State\":\"WA\",\n      \"MatchLevels\":\"E1;E2;N1;N2\"\n   },\n   \"Emails\":[  \n      {  \n         \"Email\":\"JOHN.SMITH:::at:::YAHOO.COM\",\n         \"FirstName\":\"JOHN\",\n         \"LastName\":\"SMITH\",\n         \"MatchLevel\":\"E1\"\n      }\n   ]\n}","language":"json","status":200},{"code":"{ Error: \"License key is required\" }","language":"text","status":401},{"code":"{ Error: \"An invalid match level was entered\" }","language":"json","status":400},{"code":"{ Error: \"An error has occurred. The system administrator has been contacted\" }","language":"json","status":500},{"code":"{ Error: \"First name, last name, address, city, state and match level is required\" }","language":"json","status":400}]},"examples":{"codes":[{"language":"php","code":"<?php\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\n\n$licensekey = \"\";\n\n$url =  \"https://api.accurateappend.com/Services/V2/AppendEmail/\" . $licensekey . \"/?\";\n$querystring = \"firstname=john\" .\n               \"&lastname=smith\" .\n               \"&address=\" . urlencode(\"123 main st\") .\n               \"&city=seattle\" .\n               \"&state=wa\" .\n               \"&postalcode=98101\" .\n               \"&matchlevel=E1;E2;N1;N2\";\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['Address'] = $parsed_json->{'Criteria'}->Address;\n    $response['City'] = $parsed_json->{'Criteria'}->City;\n    $response['FirstName'] = $parsed_json->{'Criteria'}->FirstName;\n    $response['LastName'] = $parsed_json->{'Criteria'}->LastName;\n    $response['PostalCode'] = $parsed_json->{'Criteria'}->PostalCode;\n    $response['State'] = $parsed_json->{'Criteria'}->State;\n\n\n    // typecast the stdClass to array\n    $obj_arr = (array)$parsed_json->{'Emails'};\n\n    if(!empty($obj_arr))\n    {\n        // iteration required for mulitple Emails response\n        for($i = 0; $i < count($parsed_json->{'Emails'}); $i++)\n        {\n            $keynum = $i + 1;\n            $response['Email_' . $keynum] = $parsed_json->{'Emails'}[$i]->Email;\n            $response['FirstName_' . $keynum] = $parsed_json->{'Emails'}[$i]->FirstName;\n            $response['LastName_' . $keynum] = $parsed_json->{'Emails'}[$i]->LastName;\n            $response['MatchLevel_' . $keynum] = $parsed_json->{'Emails'}[$i]->MatchLevel;\n        }\n    }\n    return $response;\n}\n\n?>","name":""}]},"auth":"required","params":[{"_id":"55c813200300460d00c91c3f","ref":"","in":"path","required":true,"desc":"License key issued by customer support.","default":"Default","type":"string","name":"licensekey"},{"_id":"55c8128b71d7580d0063a410","ref":"","in":"body","required":false,"desc":"Search subject's first name. Optional, if lastname is passed in the request.","default":"","type":"string","name":"firstname"},{"_id":"55c8128b71d7580d0063a40f","ref":"","in":"body","required":true,"desc":"Search subject's last name.","default":"","type":"string","name":"lastname"},{"_id":"55c8128b71d7580d0063a40e","ref":"","in":"body","required":false,"desc":"Search subject's address. Currently only US postal addresses are accepted.","default":"","type":"string","name":"address"},{"_id":"55c8128b71d7580d0063a40d","ref":"","in":"body","required":false,"desc":"City associated with search subject's address.","default":"","type":"string","name":"city"},{"_id":"55c8128b71d7580d0063a40c","ref":"","in":"body","required":true,"desc":"State associated with search subject's address.","default":"","type":"string","name":"state"},{"_id":"55c8128b71d7580d0063a40b","ref":"","in":"body","required":false,"desc":"Postal code associated with search subject's address.","default":"","type":"string","name":"postalcode"},{"_id":"55c8128b71d7580d0063a40a","ref":"","in":"body","required":false,"desc":"String delimited list of MatchLevel used to filter response. If omitted, the match levels \"E1\",\"E2\",\"N1\",\"N2\" will. be assumed.","default":"","type":"string","name":"matchlevel"}],"url":"/AppendEmail/:licensekey/?"},"isReference":false,"order":4,"body":"[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"Message\",\n    \"h-1\": \"Description\",\n    \"h-2\": \"HTTP Status Code\",\n    \"0-0\": \"License key is required\",\n    \"0-1\": \"The license key was not provided with the request. Contact customer support to obtain a license key.\",\n    \"0-2\": \"401\",\n    \"1-0\": \"First name, last name, address, city, state and match level is required.\",\n    \"1-1\": \"First name, last name, address, city, state and match level is required.\",\n    \"1-2\": \"400\",\n    \"2-0\": \"An invalid match level was entered.\",\n    \"2-1\": \"At least one valid match level indicator is required. See MatchLevel.\",\n    \"2-2\": \"400\",\n    \"3-0\": \"An error has occurred. The system administrator has been contacted.\",\n    \"3-1\": \"An internal error occurred during the execution of the service. Please contact customer support if you receive this message and provide the transactionid from the response.\",\n    \"3-2\": \"500\"\n  },\n  \"cols\": 3,\n  \"rows\": 4\n}\n[/block]","excerpt":"The following is a complete listing of error messages that could be returned by the service.","slug":"error-messages","type":"basic","title":"Error Messages"}

Error Messages

The following is a complete listing of error messages that could be returned by the service.

[block:parameters] { "data": { "h-0": "Message", "h-1": "Description", "h-2": "HTTP Status Code", "0-0": "License key is required", "0-1": "The license key was not provided with the request. Contact customer support to obtain a license key.", "0-2": "401", "1-0": "First name, last name, address, city, state and match level is required.", "1-1": "First name, last name, address, city, state and match level is required.", "1-2": "400", "2-0": "An invalid match level was entered.", "2-1": "At least one valid match level indicator is required. See MatchLevel.", "2-2": "400", "3-0": "An error has occurred. The system administrator has been contacted.", "3-1": "An internal error occurred during the execution of the service. Please contact customer support if you receive this message and provide the transactionid from the response.", "3-2": "500" }, "cols": 3, "rows": 4 } [/block]