Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /customers |
---|
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Voice.Api.Customers
Imports Voice.Api
Imports Voice.Api.Flows.Data
Imports Voice.Api.Settings
Imports Voice.Api.Scheduling
Imports Voice.Api.Integrations
Imports Voice.Api.Accounts
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
Public Partial Class ListRequest(Of T)
Implements IGet
'''<Summary>
'''The page of data to retrieve
'''</Summary>
<ApiMember(Description:="The page of data to retrieve")>
Public Overridable Property Page As Integer
'''<Summary>
'''If you want all objects to be returned. This should be used with care
'''</Summary>
<ApiMember(Description:="If you want all objects to be returned. This should be used with care")>
Public Overridable Property All As Boolean
'''<Summary>
'''The number per page to retrieve
'''</Summary>
<ApiMember(Description:="The number per page to retrieve")>
Public Overridable Property CountPerPage As Integer
'''<Summary>
'''Specific IDs
'''</Summary>
<ApiMember(Description:="Specific IDs")>
Public Overridable Property SpecificIds As List(Of String)
'''<Summary>
'''Specify a sort field
'''</Summary>
<ApiMember(Description:="Specify a sort field")>
Public Overridable Property SortField As String
'''<Summary>
'''Specify a sort order
'''</Summary>
<ApiMember(Description:="Specify a sort order")>
Public Overridable Property SortOrder As SortOrders
'''<Summary>
'''Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array
'''</Summary>
<ApiMember(Description:="Disables total / page counts - improves performance. Returns only data. If there is no more data, Items will be empty array")>
Public Overridable Property SimplifiedPaging As Boolean
End Class
Public Partial Class ListResponse(Of T)
'''<Summary>
'''The items
'''</Summary>
<ApiMember(Description:="The items")>
Public Overridable Property Items As List(Of AccountInfo)
'''<Summary>
'''The total number of items
'''</Summary>
<ApiMember(Description:="The total number of items")>
Public Overridable Property TotalCount As Integer
'''<Summary>
'''The total number of pages
'''</Summary>
<ApiMember(Description:="The total number of pages")>
Public Overridable Property TotalPages As Integer
'''<Summary>
'''Are there more pages of items? Used with simplified paging
'''</Summary>
<ApiMember(Description:="Are there more pages of items? Used with simplified paging")>
Public Overridable Property HasMorePages As Boolean
End Class
Public Enum SortOrders
Ascend
Descend
End Enum
End Namespace
Namespace Voice.Api.Accounts
Public Partial Class AccountInfo
Inherits EntityInfo
'''<Summary>
'''The name of this account
'''</Summary>
<ApiMember(Description:="The name of this account")>
Public Overridable Property Name As String
'''<Summary>
'''The ID of this account's parent
'''</Summary>
<ApiMember(Description:="The ID of this account's parent")>
Public Overridable Property ParentAccountId As String
'''<Summary>
'''The twilio account SID
'''</Summary>
<ApiMember(Description:="The twilio account SID")>
Public Overridable Property TwilioAccountSid As String
'''<Summary>
'''The ancestors of this account. Useful for breadcrumbs
'''</Summary>
<ApiMember(Description:="The ancestors of this account. Useful for breadcrumbs")>
Public Overridable Property AncestorIds As List(Of String)
'''<Summary>
'''The max number of phone numbers this account can have
'''</Summary>
<ApiMember(Description:="The max number of phone numbers this account can have")>
Public Overridable Property MaxPhoneNumbers As Integer
'''<Summary>
'''This account is BYOA
'''</Summary>
<ApiMember(Description:="This account is BYOA")>
Public Overridable Property IsBYOA As Boolean
'''<Summary>
'''TrustHub Profile Sid
'''</Summary>
<ApiMember(Description:="TrustHub Profile Sid")>
Public Overridable Property TrustHubProfileSid As String
'''<Summary>
'''The ID of the logo file
'''</Summary>
<ApiMember(Description:="The ID of the logo file")>
Public Overridable Property LogoId As String
'''<Summary>
'''The URI of the logo file
'''</Summary>
<ApiMember(Description:="The URI of the logo file")>
Public Overridable Property LogoUri As String
'''<Summary>
'''The billing settings for this account
'''</Summary>
<ApiMember(Description:="The billing settings for this account")>
Public Overridable Property BillingSettings As BillingSettings
End Class
Public Partial Class BillingItem
Public Overridable Property BaseCost As Double
Public Overridable Property RawUnitMultiplier As Double
Public Overridable Property UnitCost As Double
Public Overridable Property Allowance As Integer
End Class
Public Partial Class BillingSettings
Public Overridable Property Base As BillingItem
Public Overridable Property LocalNumbers As BillingItem
Public Overridable Property TollFreeNumbers As BillingItem
Public Overridable Property InboundVoiceCalls As BillingItem
Public Overridable Property OutboundVoiceCalls As BillingItem
Public Overridable Property InboundFaxes As BillingItem
Public Overridable Property OutboundFaxes As BillingItem
Public Overridable Property InboundSmsMessages As BillingItem
Public Overridable Property OutboundSmsMessages As BillingItem
Public Overridable Property AIInsights As BillingItem
Public Overridable Property AILiveMinutes As BillingItem
End Class
End Namespace
Namespace Voice.Api.Customers
Public Partial Class AppSettings
Public Overridable Property EnablePhoneNumberManagement As Boolean
Public Overridable Property EnableDeviceManagement As Boolean
Public Overridable Property EnableDialer As Boolean
Public Overridable Property EnableCallHistory As Boolean
Public Overridable Property EnableAssistants As Boolean
Public Overridable Property ShowFileNameInMessageCenter As Boolean
Public Overridable Property ChakraTheme As String
Public Overridable Property CustomCss As String
Public Overridable Property PageTitle As String
Public Overridable Property StringMappings As String
Public Overridable Property LogoutUrl As String
Public Overridable Property PortMyNumberUrl As String
End Class
Public Partial Class CustomerBreadcrumb
Public Overridable Property Id As String
Public Overridable Property Name As String
End Class
Public Partial Class CustomerInfo
Inherits EntityInfo
'''<Summary>
'''The ID of the account associated with this customer
'''</Summary>
<ApiMember(Description:="The ID of the account associated with this customer")>
Public Overridable Property AccountId As String
'''<Summary>
'''The parent customer ID for this customer
'''</Summary>
<ApiMember(Description:="The parent customer ID for this customer")>
Public Overridable Property ParentCustomerId As String
'''<Summary>
'''The breadcrumb to this customer
'''</Summary>
<ApiMember(Description:="The breadcrumb to this customer")>
Public Overridable Property Breadcrumb As List(Of CustomerBreadcrumb)
'''<Summary>
'''The name of the account associated with this customer
'''</Summary>
<ApiMember(Description:="The name of the account associated with this customer")>
Public Overridable Property AccountName As String
'''<Summary>
'''Is this customer staging or production?
'''</Summary>
<ApiMember(Description:="Is this customer staging or production?")>
Public Overridable Property IsStaging As Boolean
'''<Summary>
'''The name of the company
'''</Summary>
<ApiMember(Description:="The name of the company")>
Public Overridable Property Name As String
'''<Summary>
'''The reference ID for this company
'''</Summary>
<ApiMember(Description:="The reference ID for this company")>
Public Overridable Property ReferenceId As String
'''<Summary>
'''This customer's data values
'''</Summary>
<ApiMember(Description:="This customer's data values")>
Public Overridable Property Data As Struct
'''<Summary>
'''The list of tags for this customer
'''</Summary>
<ApiMember(Description:="The list of tags for this customer")>
Public Overridable Property Tags As List(Of Tag)
'''<Summary>
'''This customer's schedule
'''</Summary>
<ApiMember(Description:="This customer's schedule")>
Public Overridable Property Schedule As Schedule
'''<Summary>
'''Integration data for this customer
'''</Summary>
<ApiMember(Description:="Integration data for this customer")>
Public Overridable Property IntegrationData As EntityIntegrationData
'''<Summary>
'''Override this customer's billing settings? Otherwise inherits from parent
'''</Summary>
<ApiMember(Description:="Override this customer's billing settings? Otherwise inherits from parent")>
Public Overridable Property OverrideBillingSettings As Boolean
'''<Summary>
'''Billing settings for this customer
'''</Summary>
<ApiMember(Description:="Billing settings for this customer")>
Public Overridable Property BillingSettings As BillingSettings
'''<Summary>
'''Should this customer override the parent customer's app settings
'''</Summary>
<ApiMember(Description:="Should this customer override the parent customer's app settings")>
Public Overridable Property OverrideAppSettings As Boolean
'''<Summary>
'''App / Portal settings for this customer
'''</Summary>
<ApiMember(Description:="App / Portal settings for this customer")>
Public Overridable Property AppSettings As AppSettings
End Class
'''<Summary>
'''Retrieve customers
'''</Summary>
<Api(Description:="Retrieve customers")>
Public Partial Class ListCustomers
Inherits ListRequest(Of CustomerInfo)
'''<Summary>
'''Filter by accounts
'''</Summary>
<ApiMember(Description:="Filter by accounts")>
Public Overridable Property AccountIds As List(Of String)
'''<Summary>
'''Filter by name
'''</Summary>
<ApiMember(Description:="Filter by name")>
Public Overridable Property NameFilter As String
'''<Summary>
'''The IDs of the parent customers you want to filter by
'''</Summary>
<ApiMember(Description:="The IDs of the parent customers you want to filter by")>
Public Overridable Property ParentCustomerIds As List(Of String)
'''<Summary>
'''If you want a shall parent customer filter (e.g. no deep children)
'''</Summary>
<ApiMember(Description:="If you want a shall parent customer filter (e.g. no deep children)")>
Public Overridable Property ShallowParent As Boolean
'''<Summary>
'''The list of tag IDs to filter by (must contain all)
'''</Summary>
<ApiMember(Description:="The list of tag IDs to filter by (must contain all)")>
Public Overridable Property TagIds As List(Of String)
End Class
End Namespace
Namespace Voice.Api.Flows.Data
Public Partial Class Struct
Inherits Dictionary(Of String, Value)
End Class
Public Partial Class Value
Public Overridable Property BoolValue As Boolean?
Public Overridable Property StringValue As String
Public Overridable Property NumberValue As Double?
Public Overridable Property ListValue As List(Of Struct)
Public Overridable Property StructValue As Struct
End Class
End Namespace
Namespace Voice.Api.Integrations
Public Partial Class EntityIntegrationData
Inherits Dictionary(Of String, IntegrationData)
End Class
Public Partial Class IntegrationData
Public Overridable Property ThirdPartyId As String
End Class
End Namespace
Namespace Voice.Api.Scheduling
Public Partial Class Schedule
Public Overridable Property TimeZoneId As String
Public Overridable Property Inherit As Boolean
Public Overridable Property ForceClosed As Boolean
Public Overridable Property Rules As List(Of SchedulingRule)
Public Overridable Property DefaultState As String
End Class
Public Partial Class ScheduleDay
Public Overridable Property Offset As Integer
Public Overridable Property DayOfWeek As DayOfWeek
End Class
Public Partial Class SchedulingRule
Public Overridable Property Id As String
Public Overridable Property Name As String
Public Overridable Property Priority As Integer
Public Overridable Property State As String
Public Overridable Property Source As String
Public Overridable Property Condition As String
Public Overridable Property SimpleRuleType As SimpleSchedulingRuleTypes
Public Overridable Property CustomerState As String
Public Overridable Property FlowId As String
Public Overridable Property FlowParams As Struct
Public Overridable Property IsAllDay As Boolean
Public Overridable Property StartDate As String
Public Overridable Property StartTime As String
Public Overridable Property EndTime As String
Public Overridable Property BySetPosition As List(Of Integer)
Public Overridable Property ByMonth As List(Of Integer)
Public Overridable Property ByWeekNo As List(Of Integer)
Public Overridable Property ByYearDay As List(Of Integer)
Public Overridable Property ByMonthDay As List(Of Integer)
Public Overridable Property ByDay As List(Of ScheduleDay)
Public Overridable Property ByHour As List(Of Integer)
Public Overridable Property ByMinute As List(Of Integer)
Public Overridable Property Interval As Integer
Public Overridable Property Count As Integer
Public Overridable Property UntilDate As String
Public Overridable Property Frequency As SchedulingRuleFrequency
End Class
Public Enum SchedulingRuleFrequency
None
Secondly
Minutely
Hourly
Daily
Weekly
Monthly
Yearly
End Enum
Public Enum SimpleSchedulingRuleTypes
Always
CustomerState
Time
End Enum
End Namespace
Namespace Voice.Api.Settings
Public Partial Class Tag
Public Overridable Property Id As String
Public Overridable Property Name As String
Public Overridable Property Color As TagColors
End Class
Public Enum TagColors
Magenta
Red
Volcano
Orange
Gold
Lime
Green
Cyan
Blue
GeekBlue
Purple
End Enum
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /customers HTTP/1.1 Host: team.evovoice.io Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { items: [ { accountId: String, parentCustomerId: String, breadcrumb: [ { id: String, name: String } ], accountName: String, isStaging: False, name: String, referenceId: String, tags: [ { id: String, name: String, color: Magenta } ], schedule: { timeZoneId: String, inherit: False, forceClosed: False, rules: [ { id: String, name: String, priority: 0, state: String, source: String, condition: String, simpleRuleType: Always, customerState: String, flowId: String, isAllDay: False, startDate: String, startTime: String, endTime: String, bySetPosition: [ 0 ], byMonth: [ 0 ], byWeekNo: [ 0 ], byYearDay: [ 0 ], byMonthDay: [ 0 ], byDay: [ { offset: 0, dayOfWeek: Sunday } ], byHour: [ 0 ], byMinute: [ 0 ], interval: 0, count: 0, untilDate: String, frequency: None } ], defaultState: String }, integrationData: { String: { thirdPartyId: String } }, overrideBillingSettings: False, billingSettings: { base: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, localNumbers: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, tollFreeNumbers: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, inboundVoiceCalls: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, outboundVoiceCalls: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, inboundFaxes: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, outboundFaxes: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, inboundSmsMessages: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, outboundSmsMessages: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, aiInsights: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 }, aiLiveMinutes: { baseCost: 0, rawUnitMultiplier: 0, unitCost: 0, allowance: 0 } }, overrideAppSettings: False, appSettings: { enablePhoneNumberManagement: False, enableDeviceManagement: False, enableDialer: False, enableCallHistory: False, enableAssistants: False, showFileNameInMessageCenter: False, chakraTheme: String, customCss: String, pageTitle: String, stringMappings: String, logoutUrl: String, portMyNumberUrl: String }, id: String, dateCreated: String, dateLastModified: String, createdBy: String, lastModifiedBy: String } ], totalCount: 0, totalPages: 0, hasMorePages: False }