Bulk Update Event

This endpoint updates all Event fields for multiple Events.

Request

To update all attributes many Event(s) please make a POST request to the following URL:

HTTP MethodURL
POSThttps://industrial.api.ubidots.com/api/v2.0/events/_/bulk/update

Query Parameters

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

Body Parameters

ParameterTypeRequired?Default ValueDescription
labelStringYesN/A (required)API label of Event
nameStringNoSame as labelName of Event
descriptionStringNo""Description of Event
tagsString ArrayNo[]Tags of Event
organization<organization_key>NonullKey of Organization (Id or Label)
triggersArray of Object ArrayYesN/A (required)Triggers of Event
actionsObject ArrayYesN/A (required)Actions of Event
isActiveBooleanNoTrueIs True when Event is active
activeDatesObjectYesN/A (required)All Active Dates of Event
isGlobalEventBooleanNoFalseTrue if Event is a global event

Header

ParameterTypeDescription
X-Auth-TokenStringAuthentication Token of account
X-Bulk-OperationBooleanNeed to be set to True for the bulk operation to work
Content-TypeString (application/json)Content type of bod
curl -X POST 'https://industrial.api.ubidots.com/api/v2.0/events/_/bulk/update/' \
 -H 'Content-Type: application/json' \
 -H 'X-Auth-Token: oaXBo6ODhIjPsusNRPUGIK4d72bc73' \
 -d '{
    "label": "if-multiple-variables-then-email",
    "name": "If Multiple variables then Email",
    "description": "",
    "tags": [],
    "organization": null,
    "isActive": true,
    "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
}'
{
  "task": {
    "id": "tyg54645501a9ca5714e7b098721"
  }
}
{
    "code": 400001,
    "message": "Validation Error.",
    "detail": {
        ....
    }
}
{
    "code": 401001,
    "message": "Authentication credentials were not provided.",
    "detail": "Authentication credentials were not provided."
}
{
    "detail": "Header `X-BULK-OPERATION` should be provided for bulk operation."
}

Response

Returns an Event object of the Bulk Event updated.