Validation 仅使用Zipcode的UPS地址验证

Validation 仅使用Zipcode的UPS地址验证,validation,street-address,ups,Validation,Street Address,Ups,我正在使用UPS API进行地址验证。我对这个API非常陌生,刚刚开始学习 我只想基于zipcode验证地址,即我不想提供州名称。它在测试集成环境中不工作。有什么帮助吗 我只想使用街道地址和Zipcode验证地址。我不想提供州和城市的名称。可能吗?到目前为止还不起作用 如果我同时提供State和Zipcode,它会工作得很好 如果为PoliticalDivision1和PoliticalDivision2提供空白值,则返回的结果应包括城市和州。您仍然必须提供有效地址。您对UPS API的承诺程度

我正在使用UPS API进行地址验证。我对这个API非常陌生,刚刚开始学习

  • 我只想基于zipcode验证地址,即我不想提供州名称。它在测试集成环境中不工作。有什么帮助吗

  • 我只想使用街道地址和Zipcode验证地址。我不想提供州和城市的名称。可能吗?到目前为止还不起作用


  • 如果我同时提供State和Zipcode,它会工作得很好

    如果为PoliticalDivision1和PoliticalDivision2提供空白值,则返回的结果应包括城市和州。您仍然必须提供有效地址。

    您对UPS API的承诺程度如何?我的经验是,如果他们在API中还没有它,它不会很快发生。还有其他API可以让您仅基于地址和邮政编码来验证地址。通常,如果您有正确的邮政编码,则无需提供城市或州。地址验证的最低要求是街道地址和邮政编码或街道地址和城市/州。每个月需要验证多少个地址?如果你不需要很多,有很多免费的API可用。国家地址服务器是一个,SmartyStreets.com是另一个。(我在SmithTrave.com中工作)

    < P>在C++应用程序中,下面的XML输入用于街道级地址验证程序UPS API。请使用适当的许可证号码、用户id和密码

    <?xml version=\"1.0\"?>
    <AccessRequest   xml:lang=\"en-US\"><AccessLicenseNumber>{LicenceNo}</AccessLicenseNumber><UserId>{UserId}</UserId><Password>{Passwd}</Password></AccessRequest>
    <?xml version=\"1.0\"?>
    <AddressValidationRequest xml:lang=\"en-US\">
      <Request><TransactionReference><CustomerContext>Your Test Case Summary Description</CustomerContext><XpciVersion>1.0</XpciVersion></TransactionReference><RequestAction>XAV</RequestAction><RequestOption>3</RequestOption>
      </Request>
      <AddressKeyFormat><AddressLine>608 E. Evergreen Rd</AddressLine><PoliticalDivision2>LEBANON</PoliticalDivision2>    <PoliticalDivision1>PA</PoliticalDivision1><PostcodePrimaryLow>17042</PostcodePrimaryLow><CountryCode>US</CountryCode> </AddressKeyFormat>
    </AddressValidationRequest>
    

    除了upsapi之外,另一个潜在的解决方案是服务对象地址验证web服务。完全公开,我为服务对象工作,但web服务客观上符合您的需要

    它可以只处理address1和zipcode字段的地址。web服务可以验证信息,附加城市、州、zip+4,记录任何更正/更改,并提供指示地址可交付性的交付点验证(DPV)代码。下面是显示实际服务响应的输入和输出示例

    如果您对尝试API感兴趣,可以使用API进行测试。你想获得更多关于细节的信息,请查看

    输入示例:

    地址1:27东科塔街500号

    邮编:93101

    {
      "Addresses":[
          {
            "Address1":"27 E Cota St Ste 500",
            "Address2":"",
            "City":"Santa Barbara",
            "State":"CA",
            "Zip":"93101-7602",
            "IsResidential":"false",
            "DPV":"1",
            "DPVDesc":"Yes, the input record is a valid mailing address",
            "DPVNotes":"26,28,39",
            "DPVNotesDesc":"The input address matched the ZIP+4 record,The input address matched the DPV record,Highrise apartment\/office building address",
            "Corrections":"10,23",
            "CorrectionsDesc":"City change,State change",
            "BarcodeDigits":"931017602254",
            "CarrierRoute":"C006",
            "CongressCode":"24",
            "CountyCode":"083",
            "CountyName":"Santa Barbara",
            "FragmentHouse":"27",
            "FragmentPreDir":"E",
            "FragmentStreet":"Cota",
            "FragmentSuffix":"St",
            "FragmentPostDir":"",
            "FragmentUnit":"Ste",
            "Fragment":"500",
            "FragmentPMBPrefix":"",
            "FragmentPMBNumber":""
          }
      ],
      "IsCASS":true
    }
    

    你最好回去接受之前问题的答案,然后再期望在这里得到一个好的答案。非常感谢。我正在寻找一些地址验证API,我可以在我的web应用程序中使用。我不打算发货,所以可能无法使用UPS验证。如果我开发I/O应用程序并希望在iPhone/Android中执行地址验证,National Address或SmartyAddress api是否在iPhone/Android中工作?作为web api,SmartyStreets LiveAddress可以从任何支持web的设备调用。访问API就像URL请求一样简单。谢谢。我现在将学习这个API,并尝试在第一次尝试时从PHP代码中调用它。我会问我是否被困在某个地方。只需一个简短的附加组件,我前面提到的LiveAddressAPI现在可以在没有地址的情况下验证city/state/ZIP。这是另一个端点()
    {
      "Addresses":[
          {
            "Address1":"27 E Cota St Ste 500",
            "Address2":"",
            "City":"Santa Barbara",
            "State":"CA",
            "Zip":"93101-7602",
            "IsResidential":"false",
            "DPV":"1",
            "DPVDesc":"Yes, the input record is a valid mailing address",
            "DPVNotes":"26,28,39",
            "DPVNotesDesc":"The input address matched the ZIP+4 record,The input address matched the DPV record,Highrise apartment\/office building address",
            "Corrections":"10,23",
            "CorrectionsDesc":"City change,State change",
            "BarcodeDigits":"931017602254",
            "CarrierRoute":"C006",
            "CongressCode":"24",
            "CountyCode":"083",
            "CountyName":"Santa Barbara",
            "FragmentHouse":"27",
            "FragmentPreDir":"E",
            "FragmentStreet":"Cota",
            "FragmentSuffix":"St",
            "FragmentPostDir":"",
            "FragmentUnit":"Ste",
            "Fragment":"500",
            "FragmentPMBPrefix":"",
            "FragmentPMBNumber":""
          }
      ],
      "IsCASS":true
    }