Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

BatchUpdate may be used for more than just setting metadata on assets. It may also be used for creating combo values

...

NameExampleDescription
accessKeyeb774621-1c2f-467b-b006-a8efa67094a7accessKey that grants access to the API

...

Code Block
[{
	"Id": "MetaDataUpdate0",
	"FieldId": "MetaDataUpdate0",
	"ContainerType": 1,
	"RowId": 1,
	"Values": [{
		"FieldId": "item_metafield_labelid",
		"Type": 3,
		"Values": [51867]
	},
	{
		"FieldId": "combovalue",
		"Type": 1,
		"Values": ["test 3"]
	},
	{
		"FieldId": "optionvalue",
		"Type": 1,
		"Values": ["3"]
	},
	{
		"FieldId": "sortindex",
		"Type": 3,
		"Values": [0]
	},
	{
		"FieldId": "ispublic",
		"Type": 2,
		"Values": [true]
	},
	{
		"FieldId": "visible",
		"Type": 2,
		"Values": [true]
	}],
	"BaseId": 0
}]

NOTE: The important parts to change in this example is the combovalue which refers to the name of the combovalue, the optionvalue which refers to a unique id for it (it may be the same as the name) and the item_metafield_labelid which refers to the language version combo on which the value should be created.

cUrl data example

Info
iconfalse

curl -X POST \
'/dmm3bwsv3/BatchUpdateService.js?accesskey=eb774621-1c2f-467b-b006-a8efa67094a7' \
-H 'Cache-Control: no-cache' \
-H 'Content-Type: application/json' \
-F 'updateXML=<r><metacombo_definition fieldId="MetaDataUpdate0"><item_metafield_labelid fieldId="item_metafield_labelid"/><combovalue fieldId="combovalue"/><optionvalue fieldId="optionvalue"/><sortindex fieldId="sortindex"/><ispublic fieldId="ispublic"/><visible fieldId="visible"/></metacombo_definition></r>' \
-F 'values=[{"Id":"MetaDataUpdate0","FieldId":"MetaDataUpdate0","ContainerType":1,"RowId":1,"Values":[{"FieldId":"item_metafield_labelid","Type":3,"Values":[51867]},{"FieldId":"combovalue","Type":1,"Values":["test 3"]},{"FieldId":"optionvalue","Type":1,"Values":["3"]},{"FieldId":"sortindex","Type":3,"Values":[0]},{"FieldId":"ispublic","Type":2,"Values":[true]},{"FieldId":"visible","Type":2,"Values":[true]}],"BaseId":0}]'

...