{"id":1820,"date":"2022-11-08T00:12:02","date_gmt":"2022-11-08T00:12:02","guid":{"rendered":"https:\/\/serviceobjects.wpaladdin.com\/?post_type=serviceobjects&#038;p=1820"},"modified":"2024-03-29T13:43:15","modified_gmt":"2024-03-29T20:43:15","slug":"agi-rest","status":"publish","type":"page","link":"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/","title":{"rendered":"AGI &#8211; REST"},"content":{"rendered":"\n<div class=\"wp-block-create-block-tabs\"><ul class=\"tab-labels\" role=\"tablist\" aria-label=\"tabbed content\"><li class=\"tab-label active\" role=\"tab\" aria-selected=\"true\" aria-controls=\"C#\" tabindex=\"0\">C#<\/li><li class=\"tab-label\" role=\"tab\" aria-selected=\"false\" aria-controls=\"Java\" tabindex=\"0\">Java<\/li><\/ul><div class=\"tab-content\">\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Geocode &#8211; International C# Code Snippet<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"csharp\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"true\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/In the event that a production license key is purchased, these two variables should call sws.serviceobjects.com and swsbackup.serviceobjects.com respectively.\nstring primaryURL = \"https:\/\/trial.serviceobjects.com\/agi\/api.svc\/json\/PlaceSearch?Singleline=\" + singleline + \"&amp;Address1=\" + address1 + \"&amp;Address2=\" + address2 + \"&amp;Address3\" + address3 + \"&amp;Address4=\" + address4 + \"&amp;Address5=\" + address5 + \"&amp;Locality=\" + locality + \"&amp;AdministrativeArea=\" + administrativearea + \"&amp;PostalCode=\" + postalcode + \"&amp;Country=\" + country + \"&amp;Boundaries=\" + boundaries + \"&amp;MaxResults=\" + maxresults + \"&amp;SearchType=\" + searchtype + \"&amp;Extras=\" + extras + \"&amp;LicenseKey=\" + licenseky;\nstring backupURL = \"https:\/\/trial.serviceobjects.com\/agi\/api.svc\/json\/PlaceSearch?Singleline=\" + singleline + \"&amp;Address1=\" + address1 + \"&amp;Address2=\" + address2 + \"&amp;Address3\" + address3 + \"&amp;Address4=\" + address4 + \"&amp;Address5=\" + address5 + \"&amp;Locality=\" + locality + \"&amp;AdministrativeArea=\" + administrativearea + \"&amp;PostalCode=\" + postalcode + \"&amp;Country=\" + country + \"&amp;Boundaries=\" + boundaries + \"&amp;MaxResults=\" + maxresults + \"&amp;SearchType=\" + searchtype + \"&amp;Extras=\" + extras + \"&amp;LicenseKey=\" + licenseky;\n \ntry\n{              \n    response = CallURL&lt;SearchResponse>(primaryURL);\n \n    if (response == null || (response.Error != null &amp;&amp; response.Error.TypeCode == \"3\"))\n    {\n        throw new Exception();\n    }\n}\ncatch\n{\n    \/\/Calling Backup URL. This should be set to swsbackup.serviceobjects.com when a production key is purchased.\n    response = CallURL&lt;SearchResponse>(backupURL);\n}<\/pre>\n<\/div>\n\n\n\n<div class=\"wp-block-create-block-tab tab-panel\" role=\"tabpanel\" tabindex=\"0\">\n<p><strong>Address Geocode &#8211; International Java Code Snippet<\/strong><\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"java\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">\/\/Get the input parameters from the form\nSingleLine = request.getParameter(\"iSingleLine\");\nAddress1 = request.getParameter(\"iAddress1\");\nAddress2 = request.getParameter(\"iAddress2\");\nAddress3 = request.getParameter(\"iAddress3\");\nAddress4 = request.getParameter(\"iAddress4\");\nAddress5 = request.getParameter(\"iAddress5\");\nLocality = request.getParameter(\"iLocality\");\nAdministrativeArea = request.getParameter(\"iAdministrativeArea\");\nPostalCode = request.getParameter(\"iPostalCode\");\nCountry = request.getParameter(\"iCountry\");\nBoundaries = request.getParameter(\"iBoundaries\");\nMaxResults = request.getParameter(\"iMaxResults\");\nSearchType = request.getParameter(\"iSearchType\");\nExtras = request.getParameter(\"iExtras\");\nLicenseKey = request.getParameter(\"iLicenseKey\");\n     \nSearchResponse Response = null;\nAGIClient Client = new AGIClient();\n     \ntry{\n\/\/Make a web request to the primary URL\n    Response = Client.PlaceSearch(SingleLine, Address1, Address2, Address3, Address4, Address5,\n                                      Locality, AdministrativeArea, PostalCode, Country,\n                                      Boundaries, MaxResults, SearchType, Extras, LicenseKey);\n}\ncatch(Exception r)\n{\n    \/\/ Make a web request to the backup URL\n    AGIClient backupClient = new AGIClient();\n    Response = backupClient.PlaceSearch(SingleLine, Address1, Address2, Address3, Address4, Address5,\n                                      Locality, AdministrativeArea, PostalCode, Country,\n                                      Boundaries, MaxResults, SearchType, Extras, LicenseKey);\n}<\/pre>\n<\/div>\n<\/div><\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":1814,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1820","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>AGI - REST<\/title>\n<meta name=\"description\" content=\"C#Java Address Geocode - International C# Code Snippet \/\/In the event that a production license key is purchased, these two variables should call\" \/>\n<meta name=\"robots\" content=\"noindex, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AGI - REST\" \/>\n<meta property=\"og:description\" content=\"C#Java Address Geocode - International C# Code Snippet \/\/In the event that a production license key is purchased, these two variables should call\" \/>\n<meta property=\"og:url\" content=\"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/\" \/>\n<meta property=\"og:site_name\" content=\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-29T20:43:15+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/\",\"url\":\"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/\",\"name\":\"AGI - REST\",\"isPartOf\":{\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#website\"},\"datePublished\":\"2022-11-08T00:12:02+00:00\",\"dateModified\":\"2024-03-29T20:43:15+00:00\",\"description\":\"C#Java Address Geocode - International C# Code Snippet \/\/In the event that a production license key is purchased, these two variables should call\",\"breadcrumb\":{\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/test.serviceobjects.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"DOTS Address Geocode &#8211; International\",\"item\":\"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"AGI &#8211; Code Snippets and Sample Code\",\"item\":\"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"AGI &#8211; REST\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#website\",\"url\":\"https:\/\/test.serviceobjects.com\/docs\/\",\"name\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/test.serviceobjects.com\/docs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#organization\",\"name\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\",\"url\":\"https:\/\/test.serviceobjects.com\/docs\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/test.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png\",\"contentUrl\":\"https:\/\/test.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png\",\"width\":2560,\"height\":1440,\"caption\":\"Service Objects | Contact, Phone, Email Verification | Data Quality Services\"},\"image\":{\"@id\":\"https:\/\/test.serviceobjects.com\/docs\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AGI - REST","description":"C#Java Address Geocode - International C# Code Snippet \/\/In the event that a production license key is purchased, these two variables should call","robots":{"index":"noindex","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"og_locale":"en_US","og_type":"article","og_title":"AGI - REST","og_description":"C#Java Address Geocode - International C# Code Snippet \/\/In the event that a production license key is purchased, these two variables should call","og_url":"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/","og_site_name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","article_modified_time":"2024-03-29T20:43:15+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/","url":"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/","name":"AGI - REST","isPartOf":{"@id":"https:\/\/test.serviceobjects.com\/docs\/#website"},"datePublished":"2022-11-08T00:12:02+00:00","dateModified":"2024-03-29T20:43:15+00:00","description":"C#Java Address Geocode - International C# Code Snippet \/\/In the event that a production license key is purchased, these two variables should call","breadcrumb":{"@id":"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/agi-rest\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/test.serviceobjects.com\/docs\/"},{"@type":"ListItem","position":2,"name":"DOTS Address Geocode &#8211; International","item":"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/"},{"@type":"ListItem","position":3,"name":"AGI &#8211; Code Snippets and Sample Code","item":"https:\/\/test.serviceobjects.com\/docs\/dots-address-geocode-international\/agi-code-snippets-and-sample-code\/"},{"@type":"ListItem","position":4,"name":"AGI &#8211; REST"}]},{"@type":"WebSite","@id":"https:\/\/test.serviceobjects.com\/docs\/#website","url":"https:\/\/test.serviceobjects.com\/docs\/","name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","description":"","publisher":{"@id":"https:\/\/test.serviceobjects.com\/docs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/test.serviceobjects.com\/docs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/test.serviceobjects.com\/docs\/#organization","name":"Service Objects | Contact, Phone, Email Verification | Data Quality Services","url":"https:\/\/test.serviceobjects.com\/docs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/test.serviceobjects.com\/docs\/#\/schema\/logo\/image\/","url":"https:\/\/test.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png","contentUrl":"https:\/\/test.serviceobjects.com\/docs\/wp-content\/uploads\/2022\/08\/SO-logo-2560px-transparent.png","width":2560,"height":1440,"caption":"Service Objects | Contact, Phone, Email Verification | Data Quality Services"},"image":{"@id":"https:\/\/test.serviceobjects.com\/docs\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/1820","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/comments?post=1820"}],"version-history":[{"count":12,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/1820\/revisions"}],"predecessor-version":[{"id":10059,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/1820\/revisions\/10059"}],"up":[{"embeddable":true,"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/pages\/1814"}],"wp:attachment":[{"href":"https:\/\/test.serviceobjects.com\/docs\/wp-json\/wp\/v2\/media?parent=1820"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}