Authorization failure in USPS Address verification API

2.5k views Asked by At

Just i have a Registered with USPS which provides the US Address Validation API. I am using the following code to get the XML Response.

But, unfortunately the Response says:

Authorization Failure User 'xxxxxxxxx' is not authorized to use API Verify.USPSCOM::DoAuth.

Do i missing something?

Code:

void IsValidAddress()
{
    string USPS = "http://production.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=<AddressValidateRequest%20USERID='xxxxxxx'><Address ID='1'><Address1></Address1><Address2>8 Wildwood Drive</Address2><City>Old Lyme</City><State>CT</State><Zip5>06371</Zip5><Zip4></Zip4></Address></AddressValidateRequest>";
    WebClient wsClient = new WebClient();

    byte[] responseData = wsClient.DownloadData(USPS);

    string response = string.Empty;

    foreach (byte item in responseData)
    {
        //this will return the xml response
        response += (char)item;
    }
    string result = response;
    Response.Write(result);
}

Please see: How to Validate Address on USPS

Note: the User ID is my personal User ID that is issued by USPS Service Provider.

1

There are 1 answers

1
SHEKHAR SHETE On BEST ANSWER

To Resolve this error we need to call the USPS and ask for Verification by issuing the Registered ID with USPS and also first you can send Mail to USPS as a Feedback for this issue.