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
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Voice.Api.Alerts
Imports Voice.Api

Namespace Global

    Namespace Voice.Api

        Public Partial Class EntityInfo
            '''<Summary>
            '''The ID of the object
            '''</Summary>
            <ApiMember(Description:="The ID of the object")>
            Public Overridable Property Id As String

            '''<Summary>
            '''The date the object was created
            '''</Summary>
            <ApiMember(Description:="The date the object was created")>
            Public Overridable Property DateCreated As String

            '''<Summary>
            '''The date the object was last modified
            '''</Summary>
            <ApiMember(Description:="The date the object was last modified")>
            Public Overridable Property DateLastModified As String

            '''<Summary>
            '''The user that created this object
            '''</Summary>
            <ApiMember(Description:="The user that created this object")>
            Public Overridable Property CreatedBy As String

            '''<Summary>
            '''The user that last modified this object
            '''</Summary>
            <ApiMember(Description:="The user that last modified this object")>
            Public Overridable Property LastModifiedBy As String
        End Class
    End Namespace

    Namespace Voice.Api.Alerts

        Public Partial Class AlertInfo
            Inherits EntityInfo
            '''<Summary>
            '''The ID of the account associated with this alert
            '''</Summary>
            <ApiMember(Description:="The ID of the account associated with this alert")>
            Public Overridable Property AccountId As String

            '''<Summary>
            '''The name of the alert
            '''</Summary>
            <ApiMember(Description:="The name of the alert")>
            Public Overridable Property Name As String

            '''<Summary>
            '''The trigger alert
            '''</Summary>
            <ApiMember(Description:="The trigger alert")>
            Public Overridable Property Trigger As AlertTriggers

            '''<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 Overridable Property WindowHours As Double

            '''<Summary>
            '''The value at which the alert will trigger
            '''</Summary>
            <ApiMember(Description:="The value at which the alert will trigger")>
            Public Overridable Property Threshold As Double

            '''<Summary>
            '''The email addresses (one per line) to notify
            '''</Summary>
            <ApiMember(Description:="The email addresses (one per line) to notify")>
            Public Overridable Property NotificationEmailAddresses As String
        End Class

        Public Enum AlertTriggers
            CallSpend
        End Enum

        '''<Summary>
        '''Creates a new alert
        '''</Summary>
        <Api(Description:="Creates a new alert")>
        Public Partial Class NewAlert
            Implements IPost
            '''<Summary>
            '''The account ID to associate this alert with
            '''</Summary>
            <ApiMember(Description:="The account ID to associate this alert with")>
            Public Overridable Property AccountId As String

            '''<Summary>
            '''The name of the alert
            '''</Summary>
            <ApiMember(Description:="The name of the alert")>
            Public Overridable Property Name As String

            '''<Summary>
            '''The trigger alert
            '''</Summary>
            <ApiMember(Description:="The trigger alert")>
            Public Overridable Property Trigger As AlertTriggers

            '''<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 Overridable Property WindowHours As Double

            '''<Summary>
            '''The value at which the alert will trigger
            '''</Summary>
            <ApiMember(Description:="The value at which the alert will trigger")>
            Public Overridable Property Threshold As Double

            '''<Summary>
            '''The email addresses (one per line) to notify
            '''</Summary>
            <ApiMember(Description:="The email addresses (one per line) to notify")>
            Public Overridable Property NotificationEmailAddresses As String
        End Class
    End Namespace
End Namespace

VB.NET 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>