我尝试使用网络服务创建 prestashop 的地址,但即使我将 id_country 设置为某个值,它仍然返回
parameter \"id_country\" required
。我正在使用 Prestashop 1.7.8.9.
我请求使用此路线的身体
{{webservice_url}}/api/addresses?output_format=JSON
"address": {
"id": 9,
"id_customer": "0",
"id_manufacturer": "0",
"id_supplier": "1",
"id_warehouse": "0",
"id_country": "8",
"id_state": "35",
"alias": "supplier",
"company": "Fashion",
"lastname": "supplier",
"firstname": "supplier",
"vat_number": "",
"address1": "767 Fifth Ave.",
"address2": "",
"postcode": "10153",
"city": "New York",
"other": "",
"phone": "(212) 336-1440",
"phone_mobile": "",
"dni": "",
"deleted": "0",
"date_add": "2023-08-11 07:50:47",
"date_upd": "2023-08-11 07:50:47"
}
}
根据官方文档 Prestashop Webservices 只能输出 JSON,无法读取 JSON 输入。
参见:https://devdocs.prestashop-project.org/8/webservice/getting-started/
尝试用 XML 重写您的输入,它应该可以正常工作 - 数据对我来说看起来不错。