USPS / api-examples

76 stars 16 forks source link

How do we find userId when using the v3 oauth flow? #12

Open dpickeringjudge opened 1 year ago

dpickeringjudge commented 1 year ago

Hi, we'd like to make use of the /addresses endpoint, which requires the userId to be passed in the headers.

image

However, there doesn't seem to be a v3 introspection endpoint and if I pass the token issued from the v3 oauth endpoint, the request just hangs indefinitely.

image

is there a v3 introspection endpoint? or should i just leverage the v1 versions for everything?

dpickeringjudge commented 1 year ago

The v1 oauth endpoints seem to require a mailer id as well, and that seems to be down on dev.

image
kabutotx commented 1 year ago

I sent an email to USPS dev about similar stuff. I have OAuth V3 and Domestic Rates V3 working but Addresses is only V1 and CAT Developer Center only has V3 API support when you add your App. I don't know if a V3 token can work on V1 and I keep getting errors with Address on CAT and production. I assume Addresses will be updated to V3 like the other APIs. Will post something if I hear anything.

kabutotx commented 1 year ago

Just an update on slowly dealing with USPS. They fixed my problem on the Production side with the APIs in Pending status. I can now do an OAuth V1 and Addresses API call successfully on Production. I didn't use a x-user-id. Only Client ID, Secret, CRID, and MID. My OAuth V3 and Domestic Prices V3 works on both Prodcution and Development.

It still fails on the testing servers (CAT) as there isn't a Shipping V1 API like on Production. I am also getting errors looking up MID on gateway-cat. Luckily I found an email with it.

dpickeringjudge commented 1 year ago

nice @kabutotx -- so maybe the best bet if we want to use address is just to create a production usps app?

kabutotx commented 1 year ago

They replied to me there is an Addresses V3 but it isn't documented yet.

dpickeringjudge commented 1 year ago

so it looks like v3 addresses exists on prod (i get a 401 if i use my cat token), but not cat - where i get:

image

fascinating

kabutotx commented 1 year ago

I think you misspelled secondary.

I only tried zipcode so far.