Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

148
Vistas
usps-webtools authentication fails

I have a nodejs javascript test program as follows:

const USPS = require('usps-webtools');

const usps = new USPS({
    server: 'https://production.shippingapis.com/ShippingAPI.dll',
    userId: 'user:passwd',
    ttl: 10000 //TTL in milliseconds for request
    });
usps.verify({
    street1: '1234 Some Lane',
    city: 'AnyTown',
    state: 'MI',
    zip: '12345'
    }, function(err, address){
      console.log(err)
      console.log(address);
      });

It always returns with:

Authorization failure. Perhaps username and/or password is incorrect.

USPSCOM::DoAuth

But I can go to usps.gov and login with the same account name and password.
How does it want me to pass the username and password to it?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I just tested your code and the problem appears to be the value you are passing for the userId

Instead of passing your username and password in this format userId: 'user:passwd',

Set the userId equal to your WebTools username only.

Here is a screenshot of the email you'll receive once you register at the USPS website.

enter image description here

The docs for the USPS APIs aren't great, so we created some modern ones using Redocly at https://www.uspsweb.tools and create a public postman collection for developers to explore the APIs at https://www.postman.com/lobteam/workspace/usps-web-tools-public-workspace/overview

Best of Luck!

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda