我正在嘗試向 API 提交項(xiàng)目,請(qǐng)求通過(guò)但返回時(shí) API 返回的項(xiàng)目構(gòu)造不正確。代碼可以正常編譯和運(yùn)行,不幸的是構(gòu)建的項(xiàng)目不正確。我正在使用的 API:https://www.clover.com/api_docs/# !/inventory/CreateItem如果以上鏈接不起作用,請(qǐng)導(dǎo)航至庫(kù)存 -> 物品 -> 創(chuàng)建庫(kù)存物品。我已經(jīng)嘗試過(guò)發(fā)送到服務(wù)器的內(nèi)容,但我的問(wèn)題是 API 的 tags 參數(shù)。無(wú)論我將“標(biāo)簽”字段設(shè)置為什么,返回的項(xiàng)目都不會(huì)包含標(biāo)簽字段。我還有一個(gè) UI,可以看到所有項(xiàng)目的屬性?!皹?biāo)簽”始終為空。這是我提供的 API:{ "name":"test_item_with_label", "sku":"1234", "code":"959", "price":1698, "tags":[ { "id":"Z1JC35RHV6PFP", "name":"Sewing", "showInReporting":false } ], "priceType":"FIXED", "defaultTaxRates":true, "hidden":false, "revenue":true}這是請(qǐng)求后的項(xiàng)目屬性:{ "id": "FCMS6MSAFYK1E", "hidden": false, "name": "test_item_with_label", "code": "959", "sku": "1234", "price": 1698, "priceType": "FIXED", "defaultTaxRates": true, "isRevenue": true, "modifiedTime": 1564272103000}我希望通過(guò)帶有標(biāo)簽的 API 正確構(gòu)建項(xiàng)目。這是可供參考的標(biāo)簽。 "elements": [ { "id": "Z1JC35RHV6PFP", "name": "Sewing", "showInReporting": false }, { "id": "STBVZXTVHDYK6", "name": "Compass Industries", "showInReporting": false }, { "id": "SSWR290EAK8RM", "name": "Savor Jerky", "showInReporting": false }, { "id": "GCENM7Y4RBJE2", "name": "Triple K", "showInReporting": false }, { "id": "E9H3YC70T4D6W", "name": "Sabre/Security Equipment Co.", "showInReporting": false }, { "id": "4ANVQMMFK7MNR", "name": "Lansky Sharpeners", "showInReporting": false }, { "id": "1H66V1ZK7Y84Y", "name": "Nebo/ True Utility", "showInReporting": false }, { "id": "0PZ5R8VV61QDJ", "name": "Victorinox Swiss Army", "showInReporting": false }]
我的代碼或我使用的 API 有問(wèn)題嗎?
蠱毒傳說(shuō)
2023-04-26 15:05:09