UPS API OAuth2 Authentication in dotnet

108 views Asked by At

I am new to UPS API.

I have 4 different applications to handle UPS related tasks 1)UPSRating 2)UPSQuantumView 3)UPSShipping 4) UPSTracking

for common methods, I have one application, 'UPSCommon', and I want to use that application as a dll in the other 4 applications.

In UPSCommon, I have to write code for OAuth2 authentication. So that the other 4 applications will use the same common code for authentication and will continue doing the regular process without any impact.

How can I achieve this in DotNet? Is there any way to test this functionality in our local environment in DotNet Visual Studio to see if Oauth2 is working for other applications or not?

1

There are 1 answers

0
Dips On

I am sure you know how to get OAuth2 token from UPS API. if not follow the link over here.

https://developer.ups.com/api/reference?loc=en_US#tag/OAuthAuthCode_other

UPS OAuth token is valid for 10 days. You can store that token somewhere and utilize it and refresh it when expires and can use new token. I have not tested but I believe you will get "401 Unauthorized Request" if token is expired.