Create Material
# Description
Create material
# Request Specification
Request Method: POST + application/json
Request Path: https://${Enter cloud domain}/cgi/crm/v2/material/addMaterial
Request Headers: Refer to Common Parameters
# Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| data | Map | Yes | Data map |
| materialType | Int | Yes | Material type: 1 - create product (currently only products supported) |
| createProductArg | Map | Yes | Product creation parameters, required when materialType=1 |
| name | String | Yes | Product name |
| price | String | Yes | Price |
| discountPrice | String | Yes | Discounted price |
| videoUrl | String | Yes | Video URL (only Tencent video URLs supported). Either videoUrl or videoId must be provided; one of detail images or video must be provided. |
| videoId | String | Yes | Video library ID. Either videoUrl or videoId must be provided; one of detail images or video must be provided. |
| summary | String | Yes | Product summary |
| tryOutEnable | Boolean | Yes | Product trial: true = disabled, false = enabled |
| tryOutButtonValue | Boolean | Yes | Button label value |
| formId | Boolean | Yes | Form ID |
| headPictures | List | Yes | Product cover images, up to 3 images, recommended size: 750 x 360 |
| data | List | Yes | Image data as byte arrays |
| extension | String | Yes | Image extension |
| detailPictures | List | Yes | Product detail images, up to 20 images. One of detail images or video must be provided. |
| data | List | Yes | Image data as byte arrays |
| extension | String | Yes | Image extension |
# Request Example
{
"data": {
"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
]
}
}
}
}
# Response Parameters
| Parameter | Type | Description |
|---|---|---|
| traceId | string | Unique request ID |
| errorDescription | string | Error description |
| errorMessage | string | Error message |
| errorCode | Int | View Error Codes |
# Response Example
{
"traceId": "E-O.827xxxxxx",
"errorDescription": "success",
"errorMessage": "OK",
"errorCode": 0
}
# Notes
- Do not use the
messagefield in the response for logical judgment, aserrorMessagemay change;