Copy Event

This endpoint copy a new Event.

Request

To copy an Event please make a POST request to the following URL:

HTTP MethodURL
POSThttps://industrial.api.ubidots.com/api/v2.0/events/<event_key>/_/copy

Path Parameters

ParameterTypeDescription
event_keyStringThe id or label of the Event, label should use the prefix ~

Query Parameters

ParameterTypeUseDescription
tokenStringAuthenticationAuthentication Token can optionally be sent as a query parameter.

Header

ParameterTypeDescription
X-Auth-TokenStringAuthentication Token of account
Content-TypeString (application/json)Content type of bod
$ curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/events/123454201d84727dc57df531/_/copy' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73'
{
    "url": "https://industrial.api.ubidots.com/api/v2.0/events/123454201d84727dc57df531",
    "id": "123454201d84727dc57df531",
    "label": "if-var0-then-telegram",
    "name": "If var0 then Telegram",
    "description": "",
    "tags": [],
    "organization": null,
    "isActive": true,
    "lastTriggered": 1590043969239,
    "createdAt": "2020-04-21T06:35:12.368604Z",
    "triggers": [
        [
            {
                "type": "last_value",
                "condition": {
                    "type": "value",
                    "value": "0",
                    "operator": "==",
                    "delay": 0.0
                },
                "entity": {
                    "type": "variable",
                    "value": [
                        {
                            "id": "6492276d7ca5cf4fc79cba26"
                        }
                    ],
                    "operator": "or"
                }
            }
        ]
    ],
    "actions": [
        {
            "type": "email",
            "name": "Send Email",
            "data": {
                "emails": [
                    "[email protected]"
                ],
                "message": "Hey there, {{variable.name}} was {{last_value}} at {{trigger_timestamp|timestampformat('America/Bogota')}}.",
                "subject": "{{variable.name}} alert!"
            },
            "back_to_normal": false,
            "idGroupAction": "0pdrfbm4a"
        }
    ],
    "activeDates": {
        "dates": [
            [
                [
                    "00:00",
                    "23:59"
                ]
            ],
            [
                [
                    "00:00",
                    "23:59"
                ]
            ],
            [
                [
                    "00:00",
                    "23:59"
                ]
            ],
            [
                [
                    "00:00",
                    "23:59"
                ]
            ],
            [
                [
                    "00:00",
                    "23:59"
                ]
            ],
            [
                [
                    "00:00",
                    "23:59"
                ]
            ],
            [
                [
                    "00:00",
                    "23:59"
                ]
            ]
        ],
        "timezone": "America/Bogota"
    },
    "isGlobalEvent": false
}'
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}

Response

Returns an Event object with the requested event.