Update trigger


This request changes trigger attributes.

Resource

PATCH /triggers/<OID>

Where OID is the oid of the trigger

Parameters

None

Payload

Fields

Name Patch Operations

type

replace

action

replace

condition

replace

value

replace

active

replace

countrySettings

replace

Properties List

properties

add, remove, replace submember

properties.name

replace

properties.value

replace

properties.objectValue

replace

Object Definition

objectDefinition

remove, replace submember

objectDefinition.commonName

replace

objectDefinition.fields

add, remove, replace submember

objectDefinition.fields.type

replace

objectDefinition.fields.label

replace

objectDefinition.fields.value

replace

objectDefinition.fields.aggregation

remove, replace submember

objectDefinition.fields.orderNumber

replace

Response

None

Context

Authorization

User

Errors

Example

Request
PATCH https://xelion.nl/api/v1/master/triggers/1627410
Payload

change trigger direct member

{
    "operations": [
            {
        "op": "replace",
            "path": "/action",
            "value": "system_command"
            }
    ]
}

add new property to trigger, first add a new object with virtual id 1 and then set the submember(s) by adding replace operations on the virtual id '1'

{
    "operations": [
            {
        "op": "add",
            "path": "/properties/1",
            },
            {
        "op": "replace",
            "path": "/properties/1/name",
            "value": "property2"
            }
    ]
}

remove property from trigger, <OID> is the oid of the property

{
     "operations": [
            {
            "op": "remove",
            "path": "/properties/1726623"
            }
    ]
}

change property submember, <OID> is the oid of the property

{
    "operations": [
            {
        "op": "replace",
            "path": "/properties/1726623/value",
            "value": "0151234568"
            }
    ]
}

change object definition submember, object definition is created automaticly when not yet existst

{
    "operations": [
            {
        "op": "replace",
            "path": "/objectDefinition/commonName",
            "value": "callLog"
            }
    ]
}

add new field to object definition, first add a new object with virtual id 1 and then set the submember(s) by adding replace operations on the virtual id '1'

{
    "operations": [
            {
        "op": "add",
            "path": "/objectDefinition/fields/1"
            },
            {
        "op": "replace",
            "path": "/objectDefinition/fields/1/value",
            "value": "${date}"
            }
    ]
}

change field submember of object definition, <OID> is the oid of the field

{
    "operations": [
            {
        "op": "replace",
            "path": "/objectDefinition/fields/1726623/value",
            "value": "${callId}"
            }
    ]
}

remove field from object definition, <OID> is the oid of the field

{
     "operations": [
            {
            "op": "remove",
            "path": "/objectDefinition/fields/1726623"
            }
    ]
}

change aggregation submember from object definition field, <OID> is the oid of the field, aggregation is created automaticly when not yet existst. The aggregation member is an object definition, the object definition patch operations can also be applied to this aggregation.

{
    "operations": [
            {
        "op": "replace",
            "path": "/objectDefinition/fields/1726623/aggregation/commonName",
            "value": "phoneLine"
            }
    ]
}

remove aggregation from object definition field, <OID> is the oid of the field

{
     "operations": [
            {
            "op": "remove",
            "path": "/objectDefinition/fields/1726623/aggregation"
            }
    ]
}

remove object definition

{
     "operations": [
            {
            "op": "remove",
            "path": "/objectDefinition"
            }
    ]
}