更新大小表
方法适用于所有模式.
如果您使用API-Key令牌,调用该方法时需要具备列表中可用权限之一
- offers-and-cards-management — 商品和卡片管理
- all-methods — 全面管理商家
完全替换业务创建的大小表的名称和内容。 在一个请求中,您可以更新
多达10个表格,共5,000个单元格。 如果有更多的表或单元格,则拒绝请求。
与错误 BAD_REQUEST 并且没有一个表被更新。
Передавайте полное содержимое таблицы
所有缺失的行和列都将被删除。
只能更改业务创建的表。, — 他们有一个方法在他们的回应
POST v2/businesses/{businessId}/size-tables 指定 editable: true. 如果没有表,则返回
错误 NOT_FOUND 如果这是一个市场表(sizeTableType: STANDARD) — 错误 FORBIDDEN.
无法更改表的大小特性:根据指定的特性检查列和值
创建表时。 可以在表中使用的尺寸网格和测量值,它们的值和强制性
网格返回方法 POST v2/businesses/{businessId}/size-tables/charts.
表Id不应在单个查询中重复。 如果它们重复,请求将被拒绝。
有一个错误 BAD_REQUEST 并且没有一个表被更新。
Как заполнить таблицу
每个元素 rows — 表格行:所有尺寸网格和尺寸中的一个尺寸。 在 values
每列传递一个单元格:网格或测量ID sizeChartId 或名称
在 sizeChartName 和价值在 sizeValueId, sizeValue 或者在两个领域。 您可以跳过或传输没有值的单元格。
与一个空 sizeValue — 它将被保存为"无值"。
表的要求:
- 表必须至少有一个强制大小网格(
required: true),否则将返回错误ABSENT_MANDATORY_SIZE_CHART. 测量和网格与required: false这一要求没有得到满足。 - 在所有行中填写表中的每个所需网格,否则将返回错误。
EMPTY_CELL. - 每列必须至少有一个值,除了空值和"无值",否则将返回错误。
NONE_COLUMN. 如果没有任何东西可以填充列,请不要转移其单元格。 - 字符串必须不匹配,否则将返回错误。
DUPLICATE_ROWS. 列中的值是否允许重复? (DUPLICATE_SIZES,DUPLICATE_MEASURES),取决于尺寸特性。
Чем сохраненная таблица отличается от переданной
方法 POST v2/businesses/{businessId}/size-tables 按列返回一个表:对于每个值
有行号 rowIndex. 若要获取行,请按以下方式对值进行分组 rowIndex.
保存的表可能与传输的表不同:
- 行和列按照市场设置的顺序进行,并且
rowIndex与请求中的行号不匹配。 - 标准尺寸网格返回参考书和参考书的文本值。
sizeValueId; - 逗号替换为测量中的点。:
42,5→42.5; - 不返回具有"无值"的信元和非传输信元;
- 名称和值开头和结尾的空格已被删除。
可以将响应中的值传递给此方法,而无需修改:fields columnType 和 rowIndex 它没有考虑到。
Сохраняется содержимое из последнего запроса
表的版本不进行比较。 如果桌子在你收到后在柜子里换了,
这些更改将在没有警告的情况下被复盖。 错误 CONCURRENT_MODIFICATION 只有在以下情况下才会返回
在处理您的请求期间,该表已更改。 在这种情况下,重复请求。
表的新内容会在一段时间后自动应用于与其链接的产品。 您不需要再次转移货物。
如果查询失败与5xx代码,它可以重复:表将被替换为相同的内容。
⚙️ 没有订阅的限制: 5 请求 每分钟 ⭐️ 使用中等订阅限制: 10 请求 每分钟 |
|---|
Request
POST
https://api.partner.market.yandex.ru/v2/businesses/{businessId}/size-tables/update
Path parameters
|
Name |
Description |
|
businessId |
Type: integer 内阁ID。 Min value: |
Body
application/json
{
"sizeTables": [
{
"sizeTableId": 1,
"sizeTableName": "example",
"rows": [
{
"values": [
null
]
}
]
}
]
}
|
Name |
Description |
||||||||||||||||
|
sizeTables |
Type: object[]
大小表与新的内容。 它们按顺序处理,每个都独立于其他。 表Id不应在单个查询中重复。 如果Id重复, 请求未被处理。 总共,在所有表中 — 不超过5000个细胞。 如果有更多的单元格,则不处理请求。 Min items: Max items: Example
|
Responses
200 OK
查询顺序更新表的结果。
如果至少有一个表无法更新,则该字段 status 取值 ERROR.
其余的表被处理和保存。
Body
application/json
{
"status": "OK",
"result": {
"results": [
{
"sizeTableId": 0,
"sizeTableName": "example",
"errors": [
null
]
}
]
}
}
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
result
Type: object
results
Type: object[]
errors
Type: object[]
code
Type: string
保存尺寸图的错误代码:
INVALID_REQUEST— 表结构被破坏:名称仅由空格组成,单元格没有sizeChartId和sizeChartName(rowIndex),重复列行,单元格没有sizeValueId和sizeValue或细胞, 其中sizeChartName与列名不匹配sizeChartId(rowIndex,sizeChartId).UNKNOWN_SIZE_CHART— 尺寸网格或测量sizeChartIds不在可用的 对于表的大小特征,以及从sizeChartNames没有一个这样的专栏。INVALID_SIZE_VALUE— 值与列不匹配(rowIndex,sizeChartId).EMPTY_TABLE— 表中没有单个单元格。 它不会为与方案匹配的请求返回。 如果列中只有"无值",则返回NONE_COLUMN.EMPTY_CELL— 所需大小的网格单元未填充(rowIndex,sizeChartId).NONE_COLUMN— 在列从sizeChartIds除了"没有价值"之外没有单一的价值。DUPLICATE_ROWS— 来自rowIndices他们匹配。DUPLICATE_SIZES— 这些值在尺寸网格中重复,sizeChartIds. 取决于尺寸 特征:对于某些特征,错误在任何网格中重复时返回,对于其他特征 — 只有在表格的所有网格中都有重复的情况下。DUPLICATE_MEASURES— 这些值在测量中重复sizeChartIds. 取决于尺寸 特性:对于某些特性,允许重复测量。ABSENT_MANDATORY_SIZE_CHART— 表中没有强制尺寸网格。LIMIT_TABLES— 该业务已经具有最大表数。 只有在创作过程中。NOT_FOUND— 没有桌子。 只有在更新时。FORBIDDEN— 这是市场表(sizeTableType: STANDARD),它不能改变。 只有在更新时。CONCURRENT_MODIFICATION— 请求处理过程中更改了该表。 重复请求。 只有在更新时。INTERNAL_ERROR— 内部错误,表不保存。
Enum:
INVALID_REQUEST,UNKNOWN_SIZE_CHART,INVALID_SIZE_VALUE,EMPTY_TABLE,EMPTY_CELL,NONE_COLUMN,DUPLICATE_ROWS,DUPLICATE_SIZES,DUPLICATE_MEASURES,ABSENT_MANDATORY_SIZE_CHART,LIMIT_TABLES,NOT_FOUND,FORBIDDEN,CONCURRENT_MODIFICATION,INTERNAL_ERRORrowIndex
Type: integer
错误的行的编号
rows的请求,从0开始。 它可能与rowIndex保存的表。Min value:
0rowIndices
Type: integer[] | null
匹配行的数量
rows的请求,从0开始。Min items:
1Unique items:
trueExample
[ 0 ]sizeChartId
Type: integer
在其列中有错误的维度网格或维度的ID。
sizeChartIds
Type: integer[] | null
维网格的标识符和列中有错误的测量值.
Min items:
1Unique items:
trueExample
[ 0 ]sizeChartNames
Type: string[] | null
列名来自
sizeChartName不具有恰好一个维度网格或度量的查询。Min items:
1Unique items:
trueExample
[ "example" ]导致表无法保存的错误。
首先,检查表的结构、列和单元格值。 — 错误
INVALID_REQUEST,UNKNOWN_SIZE_CHART和INVALID_SIZE_VALUE. 如果有,则不执行其他检查。, 因此,校正后可能返回其他错误。Min items:
1Example
[ { "code": "INVALID_REQUEST", "rowIndex": 0, "sizeChartId": 0, "sizeChartIds": [ 0 ], "sizeChartNames": [ "example" ], "rowIndices": [ 0 ] } ]sizeTableId
Type: integer
保存的大小表的ID。
sizeTableName
Type: string
保存的大小图表的名称。
Example:
example查询表的结果顺序相同:
结果[i]指尺寸表[i].Example
[ { "sizeTableId": 0, "sizeTableName": "example", "errors": [ { "code": "INVALID_REQUEST", "rowIndex": 0, "sizeChartId": 0, "sizeChartIds": [ 0 ], "sizeChartNames": [ "example" ], "rowIndices": [ 0 ] } ] } ]保存大小表的结果。
Example
{ "results": [ { "sizeTableId": 0, "sizeTableName": "example", "errors": [ { "code": "INVALID_REQUEST", "rowIndex": 0, "sizeChartId": 0, "sizeChartIds": [ null ], "sizeChartNames": [ null ], "rowIndices": [ null ] } ] } ] }Example
{ "result": { "results": [ { "sizeTableId": 0, "sizeTableName": "example", "errors": [ {} ] } ] } }
400 Bad Request
查询包含不正确的数据,并且不会更新任何表。 有关错误的更多信息
错误代码 — BAD_REQUEST:查询与方法描述不匹配或表Id重复。
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
401 Unauthorized
请求中未指定授权数据。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
403 Forbidden
授权数据不正确或禁止访问资源。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
404 Not Found
找不到请求的资源。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
420 Method Failure
已超出资源访问限制。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -
500 Internal Server Error
市场的内部错误。 有关错误的更多信息
Body
application/json
{
"status": "OK",
"errors": [
{
"code": "example",
"message": "example"
}
]
}
Type: object
All of 1 type
-
Type: object
All of 2 types
-
Type: object
status
Type: string
响应的类型。 可能的值:
OK— 没有错误。ERROR— 处理请求时出错。
Enum:
OK,ERROR服务器响应的标准包装器。
Example
{ "status": "OK" } -
Type: object
errors
Type: object[]
code
Type: string
的错误代码。
Example:
examplemessage
Type: string
错误的描述。
Example:
example错误列表。
Min items:
1Example
[ { "code": "example", "message": "example" } ]Example
{ "errors": [ { "code": "example", "message": "example" } ] }
服务器错误的标准包装器。
Example
{ "status": "OK", "errors": [ { "code": "example", "message": "example" } ] } -