c# - FedEx Rating API 在 Sandbox Postmen 环境中不起作用。错误为“禁止操作”
问题描述
我在 Postmen 网站上创建了帐户:https ://secure.postmen.com/login 我获得了 API 密钥。
我指的是文档:https ://docs.postmen.com/fedex.html#rates-calculate-rates/
下面是我提交的 JSON,我收到“ Operation Forbidden ”错误。我错过了什么?我需要传递任何其他参数吗?感谢您的回复。
在 Postman Header中,我将content-type指定为application/json并同时传递postmen-api-key。由于我已经创建了帐户,因此我获得了托运人帐户 ID。
这是费率 URL: https ://secure.postmen.com/explorer/sandbox/v3/rates
我正在测试POSTMAN中的所有内容。
JSON:
{
"async": false,
"shipper_accounts": [
{
"id": "My Account ID XXXX"
}
],
"is_document": false,
"shipment": {
"ship_from": {
"contact_name": "Elmira Zulauf",
"company_name": "Kemmer-Gerhold",
"street1": "5800 Windward Pkwy",
"city": "Alpharetta",
"state": "GA",
"postal_code": "30005",
"country": "USA",
"type": "business"
},
"ship_to": {
"contact_name": "Dr. Moises Corwin",
"phone": "1-140-225-6410",
"email": "Giovanna42@yahoo.com",
"street1": "1800 W Hillcrest Dr",
"city": "Newbury Park",
"postal_code": "91320",
"state": "CA",
"country": "USA",
"type": "residential"
},
"parcels": [
{
"description": "Food XS",
"box_type": "custom",
"weight": {
"value": 2,
"unit": "kg"
},
"dimension": {
"width": 20,
"height": 40,
"depth": 40,
"unit": "cm"
},
"items": [
{
"description": "Food Bar",
"origin_country": "USA",
"quantity": 2,
"price": {
"amount": 3,
"currency": "USD"
},
"weight": {
"value": 0.6,
"unit": "kg"
},
"sku": "imac2014"
}
]
}
]
}
}
感谢您的回复。
谢谢丽塔
解决方案
如果您通过 POSTMAN 进行测试,根据https://docs.postmen.com/,计算费率的完整网址应如下所示,
沙盒:https ://sandbox-api.postmen.com/v3/rates 生产:https ://production-api.postmen.com/v3/rates
沙箱可用于测试
推荐阅读
- dynamic-programming - 如何在 R 中使用贝尔曼方程执行值迭代?
- mongodb - MongoDB将子文档作为数组返回
- python - raw text to array python
- javascript - What are the benefit of assigning function results to variables vs calling inline?
- typescript - Get correct types for reusable function with different 'data' args object
- django - Django Formset `extra` field value take huge time to load the page
- python - Scrapy Python can‘t extract links with more stable xpath
- java - 我的短信备份应用程序无法在后台运行?
- next.js - 谷歌提供商的下一个身份验证登录在表单中不起作用
- python - 检测熊猫数据框中的特定字符