| Requires any of the roles: | SystemAdministrator, Manager, Customer |
| POST | /alerts |
|---|
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>
///Creates a new alert
///</summary>
[Api(Description="Creates a new alert")]
public partial class NewAlert
: IPost
{
///<summary>
///The account ID to associate this alert with
///</summary>
[ApiMember(Description="The account ID to associate this alert with")]
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; }
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
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: text/csv
Content-Type: text/csv
Content-Length: length
{"accountId":"String","name":"String","trigger":"CallSpend","windowHours":0,"threshold":0,"notificationEmailAddresses":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"accountId":"String","name":"String","trigger":"CallSpend","windowHours":0,"threshold":0,"notificationEmailAddresses":"String","id":"String","dateCreated":"String","dateLastModified":"String","createdBy":"String","lastModifiedBy":"String"}