Przejdź do głównej zawartości

Zapisz pola elastyczne obiektu

PUT
/api/v2/AdditionalFields
curl --request PUT \
--url https://twoja-instancja-additional-fields-api.enterprise.sellrocket.pl/api/v2/AdditionalFields \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "objectId": 1, "ownerType": "example", "fields": [ { "fieldName": "example", "fieldType": "example", "fieldValue": "example", "additionalFieldDefinition": { "fieldName": "example", "fieldDisplayName": "example", "fieldType": "example", "predefinedValues": [ "example" ] } } ] }'

Tworzy lub aktualizuje wartości pól elastycznych obiektu. Pole musi mieć definicję — istniejącą albo przekazaną w żądaniu. Odpowiednik setOrderFields (custom_extra_fields) w BaseLinker.

FieldDefinitions will be created for that owner type if they do not exist yet.

object
objectId
integer format: int64
ownerType
string
nullable
fields
Array<object>
nullable
object
fieldName
string
nullable
fieldType
string
nullable
fieldValue
string
nullable
additionalFieldDefinition
object
fieldName
string
nullable
fieldDisplayName
string
nullable
fieldType
string
nullable
predefinedValues
Array<string>
nullable
Examplegenerated
{
"objectId": 1,
"ownerType": "example",
"fields": [
{
"fieldName": "example",
"fieldType": "example",
"fieldValue": "example",
"additionalFieldDefinition": {
"fieldName": "example",
"fieldDisplayName": "example",
"fieldType": "example",
"predefinedValues": [
"example"
]
}
}
]
}

Success

Typ treściapplication/json
object
objectId
integer format: int64
ownerType
string
nullable
createdFields
Array<object>
nullable
object
fieldName
string
nullable
fieldValue
string
nullable
fieldType
string
nullable
outcome
string
nullable
Examplegenerated
{
"objectId": 1,
"ownerType": "example",
"createdFields": [
{
"fieldName": "example",
"fieldValue": "example",
"fieldType": "example",
"outcome": "example"
}
]
}

Bad Request

Typ treściapplication/json
object
error
string
nullable
Examplegenerated
{
"error": "example"
}

Server Error