POST api/UnPos/Merchant/Product/UploadImage
为商品上传图片时使用的API。
Request Information
URI Parameters
None.
Body Parameters
MerchantProductUploadImageParmName | Description | Type | Additional information |
---|---|---|---|
ProductId |
商品的ID。 |
integer |
Required |
imagebase64str |
图片文件的BASE64STRING,这个BASE64的内容,将直接转换成Byte[]后,以JPG文件格式进行保存。 图片内容不要大于8M |
string |
Required Max length: 8388608 |
IsJpg |
区别图片格式。1-jpg 0-png |
string |
Required |
Request Formats
application/json, text/json
Sample:
{ "ProductId": 1, "imagebase64str": "sample string 2", "IsJpg": "sample string 3" }
application/xml, text/xml
Sample:
<MerchantProductUploadImageParm xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer.UnPos.Parms"> <IsJpg>sample string 3</IsJpg> <ProductId>1</ProductId> <imagebase64str>sample string 2</imagebase64str> </MerchantProductUploadImageParm>
application/x-www-form-urlencoded
Sample:
Sample not available.
application/bson
Sample:
Binary JSON content. See http://bsonspec.org for details.
Response Information
Resource Description
为商品上传图片时使用的API。
CommonOperationResultName | Description | Type | Additional information |
---|---|---|---|
errcode |
错误代码,通常0表示成功,其他值表示错误。 |
integer |
None. |
errmsg |
错误描述,当errcode不为零时,此值可以用于呈现给用户。 |
string |
None. |
tag |
操作同时,服务器端需要返回的其他值。 |
string |
None. |
Response Formats
application/json, text/json
Sample:
{ "errcode": 1, "errmsg": "sample string 2", "tag": "sample string 3" }
application/xml, text/xml
Sample:
<CommonOperationResult xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/DigitalScience.DataTransfer"> <errcode>1</errcode> <errmsg>sample string 2</errmsg> <tag>sample string 3</tag> </CommonOperationResult>
application/bson
Sample:
Binary JSON content. See http://bsonspec.org for details.