| Requires any of the roles: | SystemAdministrator, Manager, Customer |
| PATCH | /alerts/{alertId} |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Voice.Api.Alerts;
using Voice.Api;
namespace Voice.Api
{
public partial class EntityInfo
{
///<summary>
///The ID of the object
///</summary>
[ApiMember(Description="The ID of the object")]
public virtual string Id { get; set; }
///<summary>
///The date the object was created
///</summary>
[ApiMember(Description="The date the object was created")]
public virtual string DateCreated { get; set; }
///<summary>
///The date the object was last modified
///</summary>
[ApiMember(Description="The date the object was last modified")]
public virtual string DateLastModified { get; set; }
///<summary>
///The user that created this object
///</summary>
[ApiMember(Description="The user that created this object")]
public virtual string CreatedBy { get; set; }
///<summary>
///The user that last modified this object
///</summary>
[ApiMember(Description="The user that last modified this object")]
public virtual string LastModifiedBy { get; set; }
}
}
namespace Voice.Api.Alerts
{
public partial class AlertInfo
: EntityInfo
{
///<summary>
///The ID of the account associated with this alert
///</summary>
[ApiMember(Description="The ID of the account associated with this alert")]
public virtual string AccountId { get; set; }
///<summary>
///The name of the alert
///</summary>
[ApiMember(Description="The name of the alert")]
public virtual string Name { get; set; }
///<summary>
///The trigger alert
///</summary>
[ApiMember(Description="The trigger alert")]
public virtual AlertTriggers Trigger { get; set; }
///<summary>
///The number of hours for the window over which the alert will trigger
///</summary>
[ApiMember(Description="The number of hours for the window over which the alert will trigger")]
public virtual double WindowHours { get; set; }
///<summary>
///The value at which the alert will trigger
///</summary>
[ApiMember(Description="The value at which the alert will trigger")]
public virtual double Threshold { get; set; }
///<summary>
///The email addresses (one per line) to notify
///</summary>
[ApiMember(Description="The email addresses (one per line) to notify")]
public virtual string NotificationEmailAddresses { get; set; }
}
public enum AlertTriggers
{
CallSpend,
}
///<summary>
///Update a specific alert
///</summary>
[Api(Description="Update a specific alert")]
public partial class PatchAlert
: IPatch
{
///<summary>
///The ID of the alert you want to update
///</summary>
[ApiMember(Description="The ID of the alert you want to update")]
public virtual string AlertId { get; set; }
///<summary>
///The name for the alert
///</summary>
[ApiMember(Description="The name for the alert")]
public virtual string Name { get; set; }
///<summary>
///The trigger alert
///</summary>
[ApiMember(Description="The trigger alert")]
public virtual AlertTriggers? Trigger { get; set; }
///<summary>
///The number of hours for the window over which the alert will trigger
///</summary>
[ApiMember(Description="The number of hours for the window over which the alert will trigger")]
public virtual double? WindowHours { get; set; }
///<summary>
///The value at which the alert will trigger
///</summary>
[ApiMember(Description="The value at which the alert will trigger")]
public virtual double? Threshold { get; set; }
///<summary>
///The email addresses (one per line) to notify
///</summary>
[ApiMember(Description="The email addresses (one per line) to notify")]
public virtual string NotificationEmailAddresses { get; set; }
}
}
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.
PATCH /alerts/{alertId} HTTP/1.1
Host: evovoice.io
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<PatchAlert xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Voice.Api.Alerts">
<AlertId>String</AlertId>
<Name>String</Name>
<NotificationEmailAddresses>String</NotificationEmailAddresses>
<Threshold>0</Threshold>
<Trigger>CallSpend</Trigger>
<WindowHours>0</WindowHours>
</PatchAlert>
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>