Evo Voice

<back to all web services

NewAlert

Creates a new alert

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
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; }
    }

}

C# NewAlert DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + 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>