我们正在向sandbox-quickbooks.api.intuit.com/v3/company/{realm_id}/attachable
带有标题:
Content-Type: multipart/form-data; boundary="--fdlkjflksd--"
和正文:
--fdlkjflksd--
Content-Disposition: form-data; name="file_metadata_01"; filename="attachment.json"
Content-Type: application/json; charset=UTF-8
Content-Transfer-Encoding: 8bit
{"AttachableRef": [{"EntityRef": {"type": "Purchase", "value": "144"}}], "FileName": "one_pixel.jpeg", "ContentType": "image/jpeg"}
--fdlkjflksd--
Content-Disposition: form-data; name="file_content_01"; filename="one_pixel.jpeg"
Content-Type: image/jpeg
Content-Transfer-Encoding: base64
/9j/2wBDAP//////////////////////////////////////////////////////////////////////////////////////wAALCAABAAEBAREA/8QAFAABAAAAAAAAAAAAAAAAAAAAA//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAD8AN//Z
--fdlkjflksd--
我们正在回应:
{"Fault":{"Error":[{"Message":"Unsupported Operation","Detail":"Operation Cannot consume content type is not supported.","code":"500"}],"type":"ValidationFault"},"time":"2020-03-07T03:00:51.600-08:00"}
我们关注了this example
/attachable
端点用于链接现有附件到对象,而Content-Type
是:
application/json
/upload
终结点用于上传新附件,Content-Type
是:
multipart/form-data
[您似乎混在一起,然后向上-好像您正在尝试将新文件上传到现有文件端点。