UPS Outh Rating API 返回无效的身份验证信息

Pra*_*h v 1 integration ups oauth-2.0

我在 UPS 评级 API 集成中遇到问题。

我的请求正文是:

{
    "RateRequest": {
        "shipper": {
            "address": {
                "postal_code": "12345",
                "country_code": "US"
            }
        },
        "shipTo": {
            "address": {
                "postal_code": "54321",
                "country_code": "US"
            }
        },
        "shipment": {
            "package": {
                "dimensions": {
                    "unit_of_measurement": "IN",
                    "length": "10",
                    "width": "6",
                    "height": "4"
                },
                "weight": {
                    "unit_of_measurement": "LBS",
                    "weight": "1"
                }
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

网址 - https://wwwcie.ups.com/api/ rating/v1/Rate?additionalinfo=string

并在标头中传递访问令牌,但它总是返回

{
"response": {
"errors": [
{
"code": "250002",
"message": "Invalid Authentication Information."
}
]
}
}
Run Code Online (Sandbox Code Playgroud)

Pra*_*h v 10

我找到了答案。我没有向我的应用程序添加评级 API 权限。这就是问题所在。添加后,就可以正常使用了。

要添加评级 API,请登录您的开发者帐户并转到您的应用程序页面:

https://developer.ups.com/apps?loc=en_US

然后编辑您的应用程序并添加评级 API。