Error While getting authorization code from UPS Api

314 Views Asked by At

We are utilizing the UPS Authorization (OAuth) endpoint to obtain the authorization code. We are using the following API endpoint:

https://wwwcie.ups.com/security/v1/oauth/authorize

Here are the query parameters we are using for this request:

client_id - xxxxxxxxxxxxxxxxxxxxxxxxxxxx
redirect_uri - https://example.io/
response_type - code

We have attempted the request both with and without two optional parameters. Here are the optional parameters:

state - ups
scope - shipping(We have also tried different scope like rating, tracking, ship, etc.)

But we are getting following error:

Could not get any response
Failed to fetch

Why this might have happened:
- CORS is misconfigured on the server
- The server could not send a response
- No internet access
- Documentation issue - contact API owner
- Misconfigured security definition

Here is the link to the developer document and sandbox account that we are utilizing for this request: https://developer.ups.com/api/reference?loc=en_US#operation/AuthorizeClient

We also attempted the provided Python code from their documentation, but it didn't generate any output.

import requests

url = "https://wwwcie.ups.com/security/v1/oauth/authorize"

query = {
  "client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "redirect_uri": "https://example.io/",
  "response_type": "code",
  "state": "string",
  "scope": "tracking"
}

response = requests.get(url, params=query)

data = response.json()
print(data)

Could anyone please let me know which settings we need to be adjusted to resolve this issue?

0

There are 0 best solutions below