Update Material
# Description
Update material
# Request Specification
Method: POST + application/json
Endpoint: https://${Cloud Domain}/cgi/crm/v2/material/updateMaterial?thirdTraceId=${Random String}
Headers: Refer to Common Parameters
# Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | Map | Yes | Data MAP |
| productId | String | Yes | Product ID |
| isUpdatePicture | Boolean | Yes | Whether to update pictures |
| materialType | Int | Yes | Material type: 1-Create product (currently only supports product) |
| createProductArg | Map | Yes | Create product arguments, required when materialType=1 |
| name | String | Yes | Product name |
| price | String | Yes | Price |
| discountPrice | String | Yes | Discount price |
| videoUrl | String | Yes | Video URL (Tencent Video only), either videoUrl or videoId must be provided. Detail images or video is required. |
| videoId | String | Yes | Video library ID, either videoUrl or videoId must be provided. Detail images or video is required. |
| summary | String | Yes | Product summary |
| tryOutEnable | Boolean | Yes | Product trial: true for enabled, false for disabled |
| tryOutButtonValue | String | Yes | Button name |
| formId | String | Yes | Form ID |
| headPictures | List | Yes | Product cover images (max 3), recommended size: 750 * 360 |
| data | List | Yes | Image data (converted to byte array) |
| extension | String | Yes | Image extension |
| detailPictures | List | Yes | Product detail images (max 20), detail images or video is required |
| data | List | Yes | Image data (converted to byte array) |
| extension | String | Yes | Image extension |
# Request Example
{
"data": {
"productId": "ProductID",
"materialType": 1,
"createProductArg": {
"summary": "demoData",
"formId": "demoData",
"videoUrl": "demoData",
"tryOutButtonValue": "demoData",
"price": "demoData",
"tryOutEnable": true,
"name": "demoData",
"discountPrice": "demoData",
"detailPictures": {
"extension": "jpg",
"data": [
1
]
},
"videoId": "demoData",
"headPictures": {
"extension": "jpg",
"data": [
1
]
}
},
"isUpdatePicture": false
}
}
# Response Parameters
| Parameter | Type | Description |
|---|---|---|
| traceId | string | Request unique ID |
| errorDescription | string | Error description |
| errorMessage | string | Error message |
| errorCode | Int | Error codes |
# Response Example
{
"traceId": "E-O.827xxxxxx",
"errorDescription": "success",
"errorMessage": "OK",
"errorCode": 0
}
# Notes
- Do not use the message field in the response for logical judgment, as errorMessage may change;