Variation table header values cannot be created through the API, they can only be edited/updated.
You need to first do a GET on the Variant where the header already has a value:
/variationsTables/{variationsGrid_eid}
On the response find your target variant table definition inside "variantTables" then go to "rows":
Find the row with "method": "header":
Copy the id and the key.
For example:
"variantsTables": [
{
"id": "bd14757f-b0f1-47ee-b5c9-8163dbfbf107",
"name": "Variant-1",
"rows": [
{
"id": "fabd019a-97d3-411f-adf1-1c888e193219",
"method": "header",
"cells": [
{
"key": "5333ff62-6b53-4aa8-a7be-ff9c9380ce18",
"type": "text",
"name": "Test Header",
"content": {
"value": "TEST"
}
}
]
}
On the example above copy id fabd019a-97d3-411f-adf1-1c888e193219 and key 5333ff62-6b53-4aa8-a7be-ff9c9380ce18
Then use a patch operation on endpoint:
/variationsTables/variationsGrid_eid/variants/variant_eid?force=true
In our example, variant_eid is bd14757f-b0f1-47ee-b5c9-8163dbfbf107
Use the following PATCH body with the values you copied before:
{
"data": [
{
"type": "header",
"id": "fabd019a-97d3-411f-adf1-1c888e193219",
"attributes": {
"action": "update",
"cells": [
{
"key": "5333ff62-6b53-4aa8-a7be-ff9c9380ce18",
"content": {
"value": "MY TEST VALUE"
}
}
]
}
}
]
}
Comments
0 comments
Article is closed for comments.