Endpoint: /sites/{siteid}/event-rules

Get or create site event rules

Method & URL

GET https://[server URL]:[port]/admin/v2/sites/{siteId}/event-rules

GET Body Sample

Copy
### GET SITE EVENT RULES ###
GET https://{{host}}/admin/v2/sites/{{Siteid}}/event-rules HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}
###

GET Response Body Sample

Copy
{"data":[{"type":"eventRule","id":"8d11ec4f-3c6c-4ab9-8045-fb5c94b38ca0","attributes":{"info":{
"Description":"Backup and Cleanup","Enabled":true,"Folder":"00000000-0000-0000-0000-000000000000",
"Name":"Backup and Cleanup","Next":"a220530d-c190-4fa8-ae4a-52240f6fee94","Remote":false,"Type":"Timer",
"apiVersion":"v2","eventRuleVersion":"416"},"statements":{"StatementsList":[{"ActionStatement":{"Action":{
"CleanupAction":{"DaysToKeepFiles":30,"FileMask":"*.bak","Folder":
"C:\\ProgramData\\Globalscape\\EFT Server\\Backup","Include":true,"Recursive":false,"TimestampType":"Both"}},
"IfFailedActions":[]},"ConditionStatement":{"Conditions":[],"ElseAttachedStatements":[],
"IfAttachedStatements":[],"Operator":"Or"},"LoopDatasetStatement":{"Params":{"DatasetName":"",
"EndLoopRow":0,"OrderingColumn":"","SortOrder":"Original","StartLoopRow":0,"UseEndLoopRow":false,
"UseStartLoopRow":false},"Statements":[]},"Type":"Action"},{"ActionStatement":{"Action":{"CleanupAction":{
"DaysToKeepFiles":30,"FileMask":"*.*","Folder":"C:\\ProgramData\\Globalscape\\EFT Server\\Logs",
"Include":true,"Recursive":false,"TimestampType":"Both"}},"IfFailedActions":[]},"ConditionStatement":{
"Conditions":[],"ElseAttachedStatements":[],"IfAttachedStatements":[],"Operator":"Or"},
"LoopDatasetStatement":{"Params":{"DatasetName":"","EndLoopRow":0,"OrderingColumn":"","SortOrder":
"Original","StartLoopRow":0,"UseEndLoopRow":false,"UseStartLoopRow":false},"Statements":[]},
"Type":"Action"},{"ActionStatement":{"Action":{"BackupServerAction":{"Path":
"C:\\ProgramData\\Globalscape\\EFT Server\\Backup"}},"IfFailedActions":[{"StopAction":{
"Enabled":false,"Result":"StopThisRule"}}]},"ConditionStatement":{"Conditions":[],"ElseAttachedStatements":[],
"IfAttachedStatements":[],"Operator":"Or"},"LoopDatasetStatement":{"Params":{"DatasetName":"",
"EndLoopRow":0,"OrderingColumn":"","SortOrder":"Original","StartLoopRow":0,"UseEndLoopRow":false,
"UseStartLoopRow":false},"Statements":[]},"Type":"Action"}]},"trigger":{"TimerParams":{"DailyInfo":{
"DayPeriod":1,"EveryWeekDay":true},"EndDateEnabled":false,"EndDateTime":1659675600,"EndTimeEnabled":false,
"HolidayCalendarID":"00000000-0000-0000-0000-000000000000","MonthlyInfo":{"DayPeriod":1,"MonthPeriod":1,
"RelativeDay":"First","UseFixedDayIndexInMonth":true,"Weekday":"Sunday"},"Recurrence":"Daily",
"RepeatEnabled":false,"RepeatPattern":"Hours","RepeatRate":1,"RundayCalendarID":
"00000000-0000-0000-0000-000000000000","StartDateTime":1659675600,"WeeklyInfo":{"WeekDayFlags":1,
"WeekPeriod":1},"YearlyInfo":{"DayPeriod":1,"Month":"January","RelativeDay":"First",
"UseFixedDayIndexInFixedMonth":true,"Weekday":"Sunday"}}}},"link":{"self":
"/admin/v2/sites/6203305a-d7c6-499e-a59b-81500765f8f2/event-rules/8d11ec4f-3c6c-4ab9-8045-fb5c94b38ca0"}},
{"type":"eventRule","id":"a220530d-c190-4fa8-ae4a-52240f6fee94","attributes":{"info":{"Description":
"Execute a specified action one time or repeat at a specified interval.","Enabled":true,"Folder":
"00000000-0000-0000-0000-000000000000","Name":"SendToDrobinson","Next":"00000000-0000-0000-0000-000000000000",
"Remote":false,"Type":"Timer","apiVersion":"v2","eventRuleVersion":"416"},"statements":{
"StatementsList":[{"ActionStatement":{"Action":null,"IfFailedActions":[]},"ConditionStatement":{
"Conditions":[{"ContextVariable":"","Negate":false,"Operator":"Equals","PropertyID":1000,"Value":{
"Flag":false,"Value":"Yes"}}],"ElseAttachedStatements":[],"IfAttachedStatements":[{"ActionStatement":{
"Action":{"UploadAction":{"ConnectionProfileGUID":"00000000-0000-0000-0000-000000000000","LocalPath":
"C:\\Users\\Administrator\\Desktop\\EFT.exe","RemotePath":"/%SOURCE.FILE_NAME%","RemoveSource":false,
"TransferSettings":{"Connection":{"CertificateSettings":{"CertId":"00000000-0000-0000-0000-000000000000",
"CertPath":"","KeyPath":"","Passphrase":"UpKUJq1sD4Yfb1Hz8ZFiRw=="},"EnableAutoLogin":false,
"Host":"10.91.160.102","Password":"t7aoT+M7wIt7hzqlvPd+7g==","Port":"22","Protocol":"SFTP",
"TrustedPubKey":"","User":"drobinson"},"Transfer":{"ASCIIFileExts":["TXT","INF","HTML","HTM"],
"ClearCommandChannel":false,"ClearDataChannel":false,"ConnectionTimeout":30,"CustomProxyCommands":[],
"DataPortMode":"AUTO","DelayBetweenRetries":30,"HomeIP":"0.0.0.0","HostName":"","MaxConcurrentThreads":1,
"NumberOfConnectionRetries":0,"PASVPortMax":65535,"PASVPortMin":0,"Password":
"UpKUJq1sD4Yfb1Hz8ZFiRw==","Port":21,"PreserveLocalTimeStamp":false,"PreserveRemoteTimeStamp":false,
"ProxySeparator":"@","ProxySubType":0,"ProxyType":"FTP","SOCKSSettings":{"Auth":false,"HostName":"",
"Password":"UpKUJq1sD4Yfb1Hz8ZFiRw==","Port":1080,"Type":"None","Use":false,"UserName":""},
"TransferEncoding":"UTF8","UseProxy":false,"UserName":"","ValidateFileIntegrity":false},
"TransferAdditional":{"DeleteSourceIfMoveSkipped":true,"OverwriteType":"Overwrite","PrePostCommandSettings":{
"ContinueOnFailPost":false,"ContinueOnFailPre":false,"PostCommandArg":"","PostCommandArgDelimiter":32,
"PostCommandType":"None","PreCommandArg":"","PreCommandType":"None"},"RenameDestinationFile":false,
"RenameDestinationFileTo":"","SyncSettings":{"SyncDeleteFileIfNotPresent":false,"SyncDirectionType":"MirrorRemote",
"SyncFolders":false,"SyncIncludeSubfolders":false,"SyncOverwriteType":"Overwrite"},
"TreatMissingSourceAsSuccess":false}}}},"IfFailedActions":[{"StopAction":{"Enabled":false,
"Result":"StopThisRule"}}]},"ConditionStatement":{"Conditions":[],"ElseAttachedStatements":[],
"IfAttachedStatements":[],"Operator":"Or"},"LoopDatasetStatement":{"Params":{"DatasetName":"",
"EndLoopRow":0,"OrderingColumn":"","SortOrder":"Original","StartLoopRow":0,"UseEndLoopRow":false,
"UseStartLoopRow":false},"Statements":[]},"Type":"Action"}],"Operator":"And"},"LoopDatasetStatement":{
"Params":{"DatasetName":"","EndLoopRow":0,"OrderingColumn":"","SortOrder":"Original","StartLoopRow":0,
"UseEndLoopRow":false,"UseStartLoopRow":false},"Statements":[]},"Type":"Condition"}]},"trigger":{
"TimerParams":{"DailyInfo":{"DayPeriod":1,"EveryWeekDay":true},"EndDateEnabled":false,
"EndDateTime":1659710856,"EndTimeEnabled":false,"HolidayCalendarID":"00000000-0000-0000-0000-000000000000",
"MonthlyInfo":{"DayPeriod":1,"MonthPeriod":1,"RelativeDay":"First","UseFixedDayIndexInMonth":true,
"Weekday":"Sunday"},"Recurrence":"Continually","RepeatEnabled":true,"RepeatPattern":"Minutes",
"RepeatRate":8,"RundayCalendarID":"00000000-0000-0000-0000-000000000000","StartDateTime":1659710856,
"WeeklyInfo":{"WeekDayFlags":1,"WeekPeriod":1},"YearlyInfo":{"DayPeriod":1,"Month":"January",
"RelativeDay":"First","UseFixedDayIndexInFixedMonth":true,"Weekday":"Sunday"}}}},"link":{"self":
"/admin/v2/sites/6203305a-d7c6-499e-a59b-81500765f8f2/event-rules/a220530d-c190-4fa8-ae4a-52240f6fee94"}}]}

GET PowerShell Sample

Copy
### Returns event rule settings ###
### User must obtain the SiteID from Get Sites
Write-Output "ER"
Write-Output "----"
#$siteID = Enter SiteID here
$ERList = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/event-rules" 
-Method 'GET' -Headers $authHeader
Write-Output $ERList | ConvertTo-Json 

Method & URL

POST https://[server URL]:[port]/admin/v2/sites/{siteId}/event-rules

POST Body Sample

Copy
### CREATE EVENT RULES ###
POST https://{{host}}/admin/v2/sites/{{Siteid}}/event-rules HTTP/1.1
Authorization: EFTAdminAuthToken {{AuthToken}}

{
  "data": {
      "type": "eventRule",
      "id": "a220530d-c190-4fa8-ae4a-52240f6fee94",
      "attributes": {
        "info": {
          "Description": "Execute a specified action one time or repeat at a specified interval.",
          "Enabled": true,
          "Folder": "00000000-0000-0000-0000-000000000000",
          "Name": "SendToDrobinson",
          "Next": "00000000-0000-0000-0000-000000000000",
          "Remote": false,
          "Type": "Timer",
          "apiVersion": "v2",
          "eventRuleVersion": "416"
        },
        "statements": {
          "StatementsList": [
            {
              "ActionStatement": {
                "Action": null,
                "IfFailedActions": []
              },
              "ConditionStatement": {
                "Conditions": [
                  {
                    "ContextVariable": "",
                    "Negate": false,
                    "Operator": "Equals",
                    "PropertyID": 1000,
                    "Value": {
                      "Flag": false,
                      "Value": "Yes"
                    }
                  }
                ],
                "ElseAttachedStatements": [],
                "IfAttachedStatements": [
                  {
                    "ActionStatement": {
                      "Action": {
                        "UploadAction": {
                          "ConnectionProfileGUID": "00000000-0000-0000-0000-000000000000",
                          "LocalPath": "C:\\Users\\Administrator\\Desktop\\EFT.exe",
                          "RemotePath": "/%SOURCE.FILE_NAME%",
                          "RemoveSource": false,
                          "TransferSettings": {
                            "Connection": {
                              "CertificateSettings": {
                                "CertId": "00000000-0000-0000-0000-000000000000",
                                "CertPath": "",
                                "KeyPath": "",
                                "Passphrase": "UpKUJq1sD4Yfb1Hz8ZFiRw=="
                              },
                              "EnableAutoLogin": false,
                              "Host": "10.91.160.102",
                              "Password": "t7aoT+M7wIt7hzqlvPd+7g==",
                              "Port": "22",
                              "Protocol": "SFTP",
                              "TrustedPubKey": "",
                              "User": "drobinson"
                            },
                            "Transfer": {
                              "ASCIIFileExts": [
                                "TXT",
                                "INF",
                                "HTML",
                                "HTM"
                              ],
                              "ClearCommandChannel": false,
                              "ClearDataChannel": false,
                              "ConnectionTimeout": 30,
                              "CustomProxyCommands": [],
                              "DataPortMode": "AUTO",
                              "DelayBetweenRetries": 30,
                              "HomeIP": "0.0.0.0",
                              "HostName": "",
                              "MaxConcurrentThreads": 1,
                              "NumberOfConnectionRetries": 0,
                              "PASVPortMax": 65535,
                              "PASVPortMin": 0,
                              "Password": "UpKUJq1sD4Yfb1Hz8ZFiRw==",
                              "Port": 21,
                              "PreserveLocalTimeStamp": false,
                              "PreserveRemoteTimeStamp": false,
                              "ProxySeparator": "@",
                              "ProxySubType": 0,
                              "ProxyType": "FTP",
                              "SOCKSSettings": {
                                "Auth": false,
                                "HostName": "",
                                "Password": "UpKUJq1sD4Yfb1Hz8ZFiRw==",
                                "Port": 1080,
                                "Type": "None",
                                "Use": false,
                                "UserName": ""
                              },
                              "TransferEncoding": "UTF8",
                              "UseProxy": false,
                              "UserName": "",
                              "ValidateFileIntegrity": false
                            },
                            "TransferAdditional": {
                              "DeleteSourceIfMoveSkipped": true,
                              "OverwriteType": "Overwrite",
                              "PrePostCommandSettings": {
                                "ContinueOnFailPost": false,
                                "ContinueOnFailPre": false,
                                "PostCommandArg": "",
                                "PostCommandArgDelimiter": 32,
                                "PostCommandType": "None",
                                "PreCommandArg": "",
                                "PreCommandType": "None"
                              },
                              "RenameDestinationFile": false,
                              "RenameDestinationFileTo": "",
                              "SyncSettings": {
                                "SyncDeleteFileIfNotPresent": false,
                                "SyncDirectionType": "MirrorRemote",
                                "SyncFolders": false,
                                "SyncIncludeSubfolders": false,
                                "SyncOverwriteType": "Overwrite"
                              },
                              "TreatMissingSourceAsSuccess": false
                            }
                          }
                        }
                      },
                      "IfFailedActions": [
                        {
                          "StopAction": {
                            "Enabled": false,
                            "Result": "StopThisRule"
                          }
                        }
                      ]
                    },
                    "ConditionStatement": {
                      "Conditions": [],
                      "ElseAttachedStatements": [],
                      "IfAttachedStatements": [],
                      "Operator": "Or"
                    },
                    "LoopDatasetStatement": {
                      "Params": {
                        "DatasetName": "",
                        "EndLoopRow": 0,
                        "OrderingColumn": "",
                        "SortOrder": "Original",
                        "StartLoopRow": 0,
                        "UseEndLoopRow": false,
                        "UseStartLoopRow": false
                      },
                      "Statements": []
                    },
                    "Type": "Action"
                  }
                ],
                "Operator": "And"
              },
              "LoopDatasetStatement": {
                "Params": {
                  "DatasetName": "",
                  "EndLoopRow": 0,
                  "OrderingColumn": "",
                  "SortOrder": "Original",
                  "StartLoopRow": 0,
                  "UseEndLoopRow": false,
                  "UseStartLoopRow": false
                },
                "Statements": []
              },
              "Type": "Condition"
            }
          ]
        },
        "trigger": {
          "TimerParams": {
            "DailyInfo": {
              "DayPeriod": 1,
              "EveryWeekDay": true
            },
            "EndDateEnabled": false,
            "EndDateTime": 1659710856,
            "EndTimeEnabled": false,
            "HolidayCalendarID": "00000000-0000-0000-0000-000000000000",
            "MonthlyInfo": {
              "DayPeriod": 1,
              "MonthPeriod": 1,
              "RelativeDay": "First",
              "UseFixedDayIndexInMonth": true,
              "Weekday": "Sunday"
            },
            "Recurrence": "Continually",
            "RepeatEnabled": true,
            "RepeatPattern": "Minutes",
            "RepeatRate": 8,
            "RundayCalendarID": "00000000-0000-0000-0000-000000000000",
            "StartDateTime": 1659710856,
            "WeeklyInfo": {
              "WeekDayFlags": 1,
              "WeekPeriod": 1
            },
            "YearlyInfo": {
              "DayPeriod": 1,
              "Month": "January",
              "RelativeDay": "First",
              "UseFixedDayIndexInFixedMonth": true,
              "Weekday": "Sunday"
            }
          }
        }
    }
  }
}
###

POST Response Body Sample

Copy
{"data":{"data":[{"type":"eventRule","id":"c2320fbb-e7cc-4fde-8b41-ffa655e71e50","attributes":{"info":{
"Description":"Execute a specified action one time or repeat at a specified interval.","Enabled":true,
"Folder":"00000000-0000-0000-0000-000000000000","Name":"SendToDrobinson",
"Next":"00000000-0000-0000-0000-000000000000","Remote":false,"Type":"Timer","apiVersion":"v2",
"eventRuleVersion":"416"},"statements":{"StatementsList":[{"ActionStatement":{"Action":null,
"IfFailedActions":[]},"ConditionStatement":{"Conditions":[{"ContextVariable":"","Negate":false,
"Operator":"Equals","PropertyID":1000,"Value":{"Flag":false,"Value":"Yes"}}],"ElseAttachedStatements":[],
"IfAttachedStatements":[{"ActionStatement":{"Action":{"UploadAction":{
"ConnectionProfileGUID":"00000000-0000-0000-0000-000000000000","LocalPath":
"C:\\Users\\Administrator\\Desktop\\EFT.exe","RemotePath":"/%SOURCE.FILE_NAME%",
"RemoveSource":false,"TransferSettings":{"Connection":{"CertificateSettings":{
"CertId":"00000000-0000-0000-0000-000000000000","CertPath":"","KeyPath":"","Passphrase":"UpKUJq1sD4Yfb1Hz8ZFiRw=="},
"EnableAutoLogin":false,"Host":"10.91.160.102","Password":"t7aoT+M7wIt7hzqlvPd+7g==","Port":"22","Protocol":"SFTP",
"TrustedPubKey":"","User":"drobinson"},"Transfer":{"ASCIIFileExts":["TXT","INF","HTML","HTM"],
"ClearCommandChannel":false,"ClearDataChannel":false,"ConnectionTimeout":30,"CustomProxyCommands":[],
"DataPortMode":"AUTO","DelayBetweenRetries":30,"HomeIP":"0.0.0.0","HostName":"","MaxConcurrentThreads":1,
"NumberOfConnectionRetries":0,"PASVPortMax":65535,"PASVPortMin":0,"Password":"UpKUJq1sD4Yfb1Hz8ZFiRw==",
"Port":21,"PreserveLocalTimeStamp":false,"PreserveRemoteTimeStamp":false,"ProxySeparator":"@",
"ProxySubType":0,"ProxyType":"FTP","SOCKSSettings":{"Auth":false,"HostName":"","Password":"UpKUJq1sD4Yfb1Hz8ZFiRw==",
"Port":1080,"Type":"None","Use":false,"UserName":""},"TransferEncoding":"UTF8","UseProxy":false,"UserName":"",
"ValidateFileIntegrity":false},"TransferAdditional":{"DeleteSourceIfMoveSkipped":true,"OverwriteType":"Overwrite",
"PrePostCommandSettings":{"ContinueOnFailPost":false,"ContinueOnFailPre":false,"PostCommandArg":"",
"PostCommandArgDelimiter":32,"PostCommandType":"None","PreCommandArg":"","PreCommandType":"None"},
"RenameDestinationFile":false,"RenameDestinationFileTo":"","SyncSettings":{"SyncDeleteFileIfNotPresent":false,
"SyncDirectionType":"MirrorRemote","SyncFolders":false,"SyncIncludeSubfolders":false,"SyncOverwriteType":
"Overwrite"},"TreatMissingSourceAsSuccess":false}}}},"IfFailedActions":[{"StopAction":{"Enabled":false,
"Result":"StopThisRule"}}]},"ConditionStatement":{"Conditions":[],"ElseAttachedStatements":[],"IfAttachedStatements":[],
"Operator":"Or"},"LoopDatasetStatement":{"Params":{"DatasetName":"","EndLoopRow":0,"OrderingColumn":"",
"SortOrder":"Original","StartLoopRow":0,"UseEndLoopRow":false,"UseStartLoopRow":false},"Statements":[]},"Type":"Action"}],
"Operator":"And"},"LoopDatasetStatement":{"Params":{"DatasetName":"","EndLoopRow":0,"OrderingColumn":"",
"SortOrder":"Original","StartLoopRow":0,"UseEndLoopRow":false,"UseStartLoopRow":false},"Statements":[]},"Type":
"Condition"}]},"trigger":{"TimerParams":{"DailyInfo":{"DayPeriod":1,"EveryWeekDay":true},"EndDateEnabled":false,
"EndDateTime":1659710856,"EndTimeEnabled":false,"HolidayCalendarID":"00000000-0000-0000-0000-000000000000",
"MonthlyInfo":{"DayPeriod":1,"MonthPeriod":1,"RelativeDay":"First","UseFixedDayIndexInMonth":true,"Weekday":"Sunday"},
"Recurrence":"Continually","RepeatEnabled":true,"RepeatPattern":"Minutes","RepeatRate":8,
"RundayCalendarID":"00000000-0000-0000-0000-000000000000","StartDateTime":1659710856,"WeeklyInfo":{"WeekDayFlags":1,
"WeekPeriod":1},"YearlyInfo":{"DayPeriod":1,"Month":"January","RelativeDay":"First","UseFixedDayIndexInFixedMonth":true,
"Weekday":"Sunday"}}}},"link":{"self":"/admin/v2/sites/6203305a-d7c6-499e-a59b-81500765f8f2/
event-rules/c2320fbb-e7cc-4fde-8b41-ffa655e71e50"}}]},"links":{"self":"/admin/v2/sites/
6203305a-d7c6-499e-a59b-81500765f8f2/event-rules-all/"}}

POST PowerShell Sample

Copy
### CREATE EVENT RULES ###
##POST SITE EVENT RULE settings
Write-Output "Site Event POST"
Write-Output "-----"
$update = 

'{
  "data": {
      "type": "eventRule",
      "attributes": {
        "info": {
          "Description": "Execute a specified action one time or repeat at a specified interval.",
          "Enabled": true,
          "Folder": "00000000-0000-0000-0000-000000000000",
          "Name": "SecondSendToDrobinson",
          "Next": "00000000-0000-0000-0000-000000000000",
          "Remote": false,
          "Type": "Timer",
          "apiVersion": "v2",
          "eventRuleVersion": "416"
        },
        "statements": {
          "StatementsList": [
            {
              "ActionStatement": {
                "Action": null,
                "IfFailedActions": []
              },
              "ConditionStatement": {
                "Conditions": [
                  {
                    "ContextVariable": "",
                    "Negate": false,
                    "Operator": "Equals",
                    "PropertyID": 1000,
                    "Value": {
                      "Flag": false,
                      "Value": "Yes"
                    }
                  }
                ],
                "ElseAttachedStatements": [],
                "IfAttachedStatements": [
                  {
                    "ActionStatement": {
                      "Action": {
                        "UploadAction": {
                          "ConnectionProfileGUID": "00000000-0000-0000-0000-000000000000",
                          "LocalPath": "C:\\Users\\Administrator\\Desktop\\EFT.exe",
                          "RemotePath": "/%SOURCE.FILE_NAME%",
                          "RemoveSource": false,
                          "TransferSettings": {
                            "Connection": {
                              "CertificateSettings": {
                                "CertId": "00000000-0000-0000-0000-000000000000",
                                "CertPath": "",
                                "KeyPath": "",
                                "Passphrase": "UpKUJq1sD4Yfb1Hz8ZFiRw=="
                              },
                              "EnableAutoLogin": false,
                              "Host": "10.91.160.102",
                              "Password": "t7aoT+M7wIt7hzqlvPd+7g==",
                              "Port": "22",
                              "Protocol": "SFTP",
                              "TrustedPubKey": "",
                              "User": "drobinson"
                            },
                            "Transfer": {
                              "ASCIIFileExts": [
                                "TXT",
                                "INF",
                                "HTML",
                                "HTM"
                              ],
                              "ClearCommandChannel": false,
                              "ClearDataChannel": false,
                              "ConnectionTimeout": 30,
                              "CustomProxyCommands": [],
                              "DataPortMode": "AUTO",
                              "DelayBetweenRetries": 30,
                              "HomeIP": "0.0.0.0",
                              "HostName": "",
                              "MaxConcurrentThreads": 1,
                              "NumberOfConnectionRetries": 0,
                              "PASVPortMax": 65535,
                              "PASVPortMin": 0,
                              "Password": "UpKUJq1sD4Yfb1Hz8ZFiRw==",
                              "Port": 21,
                              "PreserveLocalTimeStamp": false,
                              "PreserveRemoteTimeStamp": false,
                              "ProxySeparator": "@",
                              "ProxySubType": 0,
                              "ProxyType": "FTP",
                              "SOCKSSettings": {
                                "Auth": false,
                                "HostName": "",
                                "Password": "UpKUJq1sD4Yfb1Hz8ZFiRw==",
                                "Port": 1080,
                                "Type": "None",
                                "Use": false,
                                "UserName": ""
                              },
                              "TransferEncoding": "UTF8",
                              "UseProxy": false,
                              "UserName": "",
                              "ValidateFileIntegrity": false
                            },
                            "TransferAdditional": {
                              "DeleteSourceIfMoveSkipped": true,
                              "OverwriteType": "Overwrite",
                              "PrePostCommandSettings": {
                                "ContinueOnFailPost": false,
                                "ContinueOnFailPre": false,
                                "PostCommandArg": "",
                                "PostCommandArgDelimiter": 32,
                                "PostCommandType": "None",
                                "PreCommandArg": "",
                                "PreCommandType": "None"
                              },
                              "RenameDestinationFile": false,
                              "RenameDestinationFileTo": "",
                              "SyncSettings": {
                                "SyncDeleteFileIfNotPresent": false,
                                "SyncDirectionType": "MirrorRemote",
                                "SyncFolders": false,
                                "SyncIncludeSubfolders": false,
                                "SyncOverwriteType": "Overwrite"
                              },
                              "TreatMissingSourceAsSuccess": false
                            }
                          }
                        }
                      },
                      "IfFailedActions": [
                        {
                          "StopAction": {
                            "Enabled": false,
                            "Result": "StopThisRule"
                          }
                        }
                      ]
                    },
                    "ConditionStatement": {
                      "Conditions": [],
                      "ElseAttachedStatements": [],
                      "IfAttachedStatements": [],
                      "Operator": "Or"
                    },
                    "LoopDatasetStatement": {
                      "Params": {
                        "DatasetName": "",
                        "EndLoopRow": 0,
                        "OrderingColumn": "",
                        "SortOrder": "Original",
                        "StartLoopRow": 0,
                        "UseEndLoopRow": false,
                        "UseStartLoopRow": false
                      },
                      "Statements": []
                    },
                    "Type": "Action"
                  }
                ],
                "Operator": "And"
              },
              "LoopDatasetStatement": {
                "Params": {
                  "DatasetName": "",
                  "EndLoopRow": 0,
                  "OrderingColumn": "",
                  "SortOrder": "Original",
                  "StartLoopRow": 0,
                  "UseEndLoopRow": false,
                  "UseStartLoopRow": false
                },
                "Statements": []
              },
              "Type": "Condition"
            }
          ]
        },
        "trigger": {
          "TimerParams": {
            "DailyInfo": {
              "DayPeriod": 1,
              "EveryWeekDay": true
            },
            "EndDateEnabled": false,
            "EndDateTime": 1659710856,
            "EndTimeEnabled": false,
            "HolidayCalendarID": "00000000-0000-0000-0000-000000000000",
            "MonthlyInfo": {
              "DayPeriod": 1,
              "MonthPeriod": 1,
              "RelativeDay": "First",
              "UseFixedDayIndexInMonth": true,
              "Weekday": "Sunday"
            },
            "Recurrence": "Continually",
            "RepeatEnabled": true,
            "RepeatPattern": "Minutes",
            "RepeatRate": 8,
            "RundayCalendarID": "00000000-0000-0000-0000-000000000000",
            "StartDateTime": 1659710856,
            "WeeklyInfo": {
              "WeekDayFlags": 1,
              "WeekPeriod": 1
            },
            "YearlyInfo": {
              "DayPeriod": 1,
              "Month": "January",
              "RelativeDay": "First",
              "UseFixedDayIndexInFixedMonth": true,
              "Weekday": "Sunday"
            }
          }
        }
    }
  }
}'

$update = $update | ConvertFrom-Json
$update = $update | ConvertTo-Json -Depth 10
$eventReturn = Invoke-RestMethod -Uri "$baseURL/v2/sites/$siteID/event-rules" 
Method 'POST' -Headers $authHeader -Body $update
Write-Output $eventReturn | ConvertTo-Json