我在 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"
}
}
}
}
}
URL - https://wwwcie.ups.com/api/ rating/v1/Rate?additionalinfo=string
并在标头中传递访问令牌,但它总是返回
{
"response": {
"errors": [
{
"code": "250002",
"message": "Invalid Authentication Information."
}
]
}
}
我找到了答案。 我没有向我的应用程序添加评级 API 权限。这就是问题所在。 添加后,运行正常。
要添加评级 API,请登录您的开发者帐户并转到您的应用程序页面:
https://developer.ups.com/apps?loc=en_US
然后编辑您的应用程序并添加评级 API。
You need to add API permissions in the 'App/Edit App Add Products' section.