5

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.

abatishchev
  • 98,240
  • 88
  • 296
  • 433
SHEKHAR SHETE
  • 5,964
  • 15
  • 85
  • 143
  • I'd say you should ask the API provider – Alex Dec 05 '13 at 12:14
  • Unfortunately, as a free service, they provide no support. – Matt Dec 05 '13 at 14:27
  • Mine just started doing this after years of trouble-free service. Perhaps a subtle API change has occurred? – Malachi Dec 06 '13 at 22:01
  • Did you ever figure this out? I'm getting the same error – Aaron Hill Mar 05 '14 at 18:45
  • hi @AaronHill i have added solution to this please see..! – SHEKHAR SHETE Mar 06 '14 at 04:07
  • 1
    hi @abatishchev let me know why you removed the Support Contact Email & Phone details. this may help the people who are facing these problems instead of overlooking again for support details..isnt it? – SHEKHAR SHETE Mar 06 '14 at 04:57
  • Hi! This site is about coding, not business application support. If you post a code this really helps. But if you need to contact support to solve an issue, support contacts are not necessary. Anybody who need it can google. – abatishchev Mar 06 '14 at 05:05
  • 1
    yes i agree this is site is about coding! but, why should he google again if he is getting the exact what he is searching for? and this answer is not out of scope to this question. as i think and will definitely help the people who are looking for..! This what STACKOVERFLOW is well known for all the problems are solved here..right? and me too a developer and not an "Advertiser" to mention all these...! – SHEKHAR SHETE Mar 06 '14 at 09:16

1 Answers1

4

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.

Steven V
  • 16,357
  • 3
  • 63
  • 76
SHEKHAR SHETE
  • 5,964
  • 15
  • 85
  • 143
  • Go here: https://usps.force.com/emailus/s/. Then click on USPS.com > Web Tools > Add Permissions and send them an email with the following information: "Web Tools API Access" in the subject line of the email Which APIs you want to access beyond those provided automatically If you'll be modifying the label image – Prashant Saraswat Jun 13 '20 at 15:57