Create Trigger


This request adds a trigger to the database.

Resource

POST /triggers

Payload

Response

The created object.

Context

Authorization

Administration

Errors

Example

Request
POST https://xelion.nl/api/v1/master/triggers
Payload
{
    "type": "new_call",
    "action": "system_command",
    "condition": "${incoming}=1",
    "value": "c:\opencard.exe",
    "active": true,
    "properties": [
        {
            "name": "property1",
            "value": "",
            "objectValue": {
                "oid": "123456",
                "objectType": "Person"
            }
        },
        {
            "name": "prop2",
            "value": "programmer"
        }
    ],
    "objectDefinition": {
        "commonName": "callLog",
        "fields": [
            {
              "type": "stringType",
              "label": "id",
              "value": "${callId}"
            },
            {
                "type": "objectType",
                "aggregation": {
                    "commonName": "line",
                    "fields": [
                        {
                            "type": "stringType",
                            "label": "label",
                            "value": "${commonName}"
                        }
                    ]
                }
            }
        ]
    },
    "countrySettings": {
        "oid": "1737342",
        "objectType": "XCCCountrySettings"
    },
    "commonName": "testtrigger1234",
    "objectType": "XCCTrigger"
}
Response
{
    "object": {
        "type": "new_call",
        "action": "system_command",
        "condition": "${incoming}=1",
        "value": "c:\opencard.exe",
        "active": true,
        "properties": [
            {
                "name": "property1",
                "value": "",
                "objectValue": {
                    "oid": "123456",
                    "objectType": "Person"
                },
                "objectType": "XCCTriggerProperty"
            },
            {
                "name": "prop2",
                "value": "programmer"
            }
        ],
        "objectDefinitiom": {
            "commonName": "callLog",
            "fields": [
                {
                    "type": "stringType",
                    "label": "id",
                    "value": "${callId}",
                    "objectType": "ExternalFieldDefinition"
                },
                {
                    "type": "objectType",
                    "aggregation": {
                        "commonName": "line",
                        "fields": [
                            {
                                "type": "stringType",
                                "label": "label",
                                "value": "${commonName}",
                                "objectType": "ExternalFieldDefinition"
                            }
                       ],
                       "oid": "1801494",
                       "objectType": "ExternalObjectDefinition"
                    },
                    "objectType": "ExternalFieldDefinition"
                }
            ],
            "oid": "1801491",
            "objectType": "ExternalObjectDefinition"
        },
        "countrySettings": {
            "permissions": "ReadWriteRemove",
            "commonName": "Nederland",
            "oid": "1737342",
            "objectType": "XCCCountrySettings"
        },
        "commonName": "testtrigger1234",
        "oid": "453456",
        "objectType": "XCCTrigger"
    },
    "links": [
        {
            "rel": "self",
            "href": "https://xelion.nl/api/v1/master/triggers/1801487",
            "method": "GET"
        }
    ]
}