| Requires any of the roles: | SystemAdministrator, Manager, Customer |
| POST | /alerts |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
/**
* Creates a new alert
*/
@Api(Description="Creates a new alert")
public static class NewAlert implements IPost
{
/**
* The account ID to associate this alert with
*/
@ApiMember(Description="The account ID to associate this alert with")
public String accountId = null;
/**
* The name of the alert
*/
@ApiMember(Description="The name of the alert")
public String name = null;
/**
* The trigger alert
*/
@ApiMember(Description="The trigger alert")
public AlertTriggers trigger = null;
/**
* The number of hours for the window over which the alert will trigger
*/
@ApiMember(Description="The number of hours for the window over which the alert will trigger")
public Double windowHours = null;
/**
* The value at which the alert will trigger
*/
@ApiMember(Description="The value at which the alert will trigger")
public Double threshold = null;
/**
* The email addresses (one per line) to notify
*/
@ApiMember(Description="The email addresses (one per line) to notify")
public String notificationEmailAddresses = null;
public String getAccountId() { return accountId; }
public NewAlert setAccountId(String value) { this.accountId = value; return this; }
public String getName() { return name; }
public NewAlert setName(String value) { this.name = value; return this; }
public AlertTriggers getTrigger() { return trigger; }
public NewAlert setTrigger(AlertTriggers value) { this.trigger = value; return this; }
public Double getWindowHours() { return windowHours; }
public NewAlert setWindowHours(Double value) { this.windowHours = value; return this; }
public Double getThreshold() { return threshold; }
public NewAlert setThreshold(Double value) { this.threshold = value; return this; }
public String getNotificationEmailAddresses() { return notificationEmailAddresses; }
public NewAlert setNotificationEmailAddresses(String value) { this.notificationEmailAddresses = value; return this; }
}
public static enum AlertTriggers
{
CallSpend;
}
public static class AlertInfo extends EntityInfo
{
/**
* The ID of the account associated with this alert
*/
@ApiMember(Description="The ID of the account associated with this alert")
public String accountId = null;
/**
* The name of the alert
*/
@ApiMember(Description="The name of the alert")
public String name = null;
/**
* The trigger alert
*/
@ApiMember(Description="The trigger alert")
public AlertTriggers trigger = null;
/**
* The number of hours for the window over which the alert will trigger
*/
@ApiMember(Description="The number of hours for the window over which the alert will trigger")
public Double windowHours = null;
/**
* The value at which the alert will trigger
*/
@ApiMember(Description="The value at which the alert will trigger")
public Double threshold = null;
/**
* The email addresses (one per line) to notify
*/
@ApiMember(Description="The email addresses (one per line) to notify")
public String notificationEmailAddresses = null;
public String getAccountId() { return accountId; }
public AlertInfo setAccountId(String value) { this.accountId = value; return this; }
public String getName() { return name; }
public AlertInfo setName(String value) { this.name = value; return this; }
public AlertTriggers getTrigger() { return trigger; }
public AlertInfo setTrigger(AlertTriggers value) { this.trigger = value; return this; }
public Double getWindowHours() { return windowHours; }
public AlertInfo setWindowHours(Double value) { this.windowHours = value; return this; }
public Double getThreshold() { return threshold; }
public AlertInfo setThreshold(Double value) { this.threshold = value; return this; }
public String getNotificationEmailAddresses() { return notificationEmailAddresses; }
public AlertInfo setNotificationEmailAddresses(String value) { this.notificationEmailAddresses = value; return this; }
}
public static class EntityInfo
{
/**
* The ID of the object
*/
@ApiMember(Description="The ID of the object")
public String id = null;
/**
* The date the object was created
*/
@ApiMember(Description="The date the object was created")
public String dateCreated = null;
/**
* The date the object was last modified
*/
@ApiMember(Description="The date the object was last modified")
public String dateLastModified = null;
/**
* The user that created this object
*/
@ApiMember(Description="The user that created this object")
public String createdBy = null;
/**
* The user that last modified this object
*/
@ApiMember(Description="The user that last modified this object")
public String lastModifiedBy = null;
public String getId() { return id; }
public EntityInfo setId(String value) { this.id = value; return this; }
public String getDateCreated() { return dateCreated; }
public EntityInfo setDateCreated(String value) { this.dateCreated = value; return this; }
public String getDateLastModified() { return dateLastModified; }
public EntityInfo setDateLastModified(String value) { this.dateLastModified = value; return this; }
public String getCreatedBy() { return createdBy; }
public EntityInfo setCreatedBy(String value) { this.createdBy = value; return this; }
public String getLastModifiedBy() { return lastModifiedBy; }
public EntityInfo setLastModifiedBy(String value) { this.lastModifiedBy = value; return this; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /alerts HTTP/1.1
Host: evovoice.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<NewAlert xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Alerts">
<AccountId>String</AccountId>
<Name>String</Name>
<NotificationEmailAddresses>String</NotificationEmailAddresses>
<Threshold>0</Threshold>
<Trigger>CallSpend</Trigger>
<WindowHours>0</WindowHours>
</NewAlert>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <AlertInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Alerts"> <CreatedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</CreatedBy> <DateCreated xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateCreated> <DateLastModified xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</DateLastModified> <Id xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</Id> <LastModifiedBy xmlns="http://schemas.datacontract.org/2004/07/Voice.Api">String</LastModifiedBy> <AccountId>String</AccountId> <Name>String</Name> <NotificationEmailAddresses>String</NotificationEmailAddresses> <Threshold>0</Threshold> <Trigger>CallSpend</Trigger> <WindowHours>0</WindowHours> </AlertInfo>