POST Alert/Update

Update an alert

Request Information

URI Parameters

None.

Body Parameters

Alert to be updated

Alert
NameDescriptionTypeAdditional information
ClientID

integer

Required

ClientSiteID

integer

Required

ID

For Update: ID of the alert to be updated. For creation, this attribute is not used.

integer

None.

Title

Title of the alert

string

Required

Max length: 256

Content

Content of the alert.

string

Required

Max length: 20000

StartAt

Date and time when an alert becomes avaiable

date

Required

EndAt

Date and time when an alert expires

date

Required

IsPublic

True if the alert is avaiable to all subscribers

boolean

Required

Recipients

If IsPublic = false, then this attributes contain the list of username that can see the alert.

Collection of string

None.

TypeOfAlert

Type of alert

AlertType

None.

Gateway

Gateway where the alert will be sent

Gateway

None.

PageUrls

A comma separated list of Urls where the alert will be displayed. If null or *, then the alert will be displayed in all pages.

string

Max length: 2000

OKButton

Caption for the OK button. If null, then the default value "OK" is used.

string

Max length: 100

CancelButton

Caption for the Cancel button. If null, then the default value "Cancel" is used.

string

Max length: 100

Autoclose

If not null, then this is the number of seconds afte which the Timed alert will close.

integer

None.

CancelEvent

Event that will be invoked if the user clicks the Cancel button for a "Must Agree" alert.

CancelEvent

None.

AlertMsg

Message to be displayed if the user clicks the Cancel button for a "Must Agree" alert.

string

Max length: 2000

RedirectUrl

Url where the browser will be redirected to if the user clicks the Cancel button for a "Must Agree" alert.

string

Max length: 2000

Department

Only users from this Department that can view the alert. If null, then all Department can view the alert

string

Max length: 50

Roles

A comma separated list of Roles that can view the alert. If null, then all Roles can view the alert

string

Max length: 4000

Request Formats

application/json, text/json

Sample:
{
  "ClientID": 1,
  "ClientSiteID": 2,
  "ID": 3,
  "Title": "sample string 4",
  "Content": "sample string 5",
  "StartAt": "2024-12-23T11:30:53.4634413-08:00",
  "EndAt": "2024-12-23T11:30:53.4634413-08:00",
  "IsPublic": true,
  "Recipients": [
    "sample string 1",
    "sample string 2"
  ],
  "TypeOfAlert": 0,
  "Gateway": 1,
  "PageUrls": "sample string 9",
  "OKButton": "sample string 10",
  "CancelButton": "sample string 11",
  "Autoclose": 1,
  "CancelEvent": 1,
  "AlertMsg": "sample string 12",
  "RedirectUrl": "sample string 13",
  "Department": "sample string 14",
  "Roles": "sample string 15"
}

application/xml, text/xml

Sample:
<Alert xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PiSuite.DataModels.Api4Client">
  <AlertMsg>sample string 12</AlertMsg>
  <Autoclose>1</Autoclose>
  <CancelButton>sample string 11</CancelButton>
  <CancelEvent>ShowMessage</CancelEvent>
  <ClientID>1</ClientID>
  <ClientSiteID>2</ClientSiteID>
  <Content>sample string 5</Content>
  <Department>sample string 14</Department>
  <EndAt>2024-12-23T11:30:53.4634413-08:00</EndAt>
  <Gateway>Web</Gateway>
  <ID>3</ID>
  <IsPublic>true</IsPublic>
  <OKButton>sample string 10</OKButton>
  <PageUrls>sample string 9</PageUrls>
  <Recipients xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:string>sample string 1</d2p1:string>
    <d2p1:string>sample string 2</d2p1:string>
  </Recipients>
  <RedirectUrl>sample string 13</RedirectUrl>
  <Roles>sample string 15</Roles>
  <StartAt>2024-12-23T11:30:53.4634413-08:00</StartAt>
  <Title>sample string 4</Title>
  <TypeOfAlert>Info</TypeOfAlert>
</Alert>

application/x-www-form-urlencoded

Sample:

Sample not available.

Response Information

Resource Description

Status of update

AlertUpdateStatus

Response Formats

application/json, text/json

Sample:
1

application/xml, text/xml

Sample:
<AlertUpdateStatus xmlns="http://schemas.datacontract.org/2004/07/PiSuite.DataModels.Api4Client">Updated</AlertUpdateStatus>