0

I'm working on a website in where some customers have the options to insert UPS Api credentials (key, username and password), and based on those credentials, UPS TimeInTransit and Tracking API are used.

I'm looking for a solution to validate these credentials before storing them for later use.

Fellner Arthur
  • 217
  • 3
  • 17

1 Answers1

0

why do not you make a API request (the smallest one), using the credentials to check the response code. If UPS reply a error, you can also reply the error. If the response it's OK, than store the credentials. Can take a little long, but without that request you will not be able to check the credentials.

andre-lx
  • 312
  • 3
  • 14
  • I've already tried that, I've accessed the Track api using a test tracking number and i receive an "invalid license number" message when the access key is invalid, but for invalid username and password I receive "no tracking information available" which is to be expected because I use a test tracking number. Thanks for the suggestion, I will further try with the other API services, I just thought that there might be a more elegant way to achieve this – Fellner Arthur Jan 09 '19 at 13:29
  • So your problem is with username and password. With wrong api key you receive a valid error. But with username and password you only receive the "no tracking information". So you cannot tell if the username and password is incorrect OR the tracking number doesn't exist. I understood well? – andre-lx Jan 09 '19 at 13:34
  • Also, the same problem if I try address validation service ( I think this is the smallest service call ). If the key is invalid I receive an expected Failure code, but if the username or password are invalid I receive a success response – Fellner Arthur Jan 09 '19 at 13:59