Evo Voice

<back to all web services

ListCustomers

Retrieve customers

Requires Authentication
Requires any of the roles:SystemAdministrator, Manager, Customer
The following routes are available for this service:
GET/customers
namespace Voice.Api

open System
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type EntityInfo() = 
        ///<summary>
        ///The ID of the object
        ///</summary>
        [<ApiMember(Description="The ID of the object")>]
        member val Id:String = null with get,set

        ///<summary>
        ///The date the object was created
        ///</summary>
        [<ApiMember(Description="The date the object was created")>]
        member val DateCreated:String = null with get,set

        ///<summary>
        ///The date the object was last modified
        ///</summary>
        [<ApiMember(Description="The date the object was last modified")>]
        member val DateLastModified:String = null with get,set

        ///<summary>
        ///The user that created this object
        ///</summary>
        [<ApiMember(Description="The user that created this object")>]
        member val CreatedBy:String = null with get,set

        ///<summary>
        ///The user that last modified this object
        ///</summary>
        [<ApiMember(Description="The user that last modified this object")>]
        member val LastModifiedBy:String = null with get,set

    [<AllowNullLiteral>]
    type CustomerBreadcrumb() = 
        member val Id:String = null with get,set
        member val Name:String = null with get,set

    [<AllowNullLiteral>]
    type Value() = 
        member val BoolValue:Nullable<Boolean> = new Nullable<Boolean>() with get,set
        member val StringValue:String = null with get,set
        member val NumberValue:Nullable<Double> = new Nullable<Double>() with get,set
        member val ListValue:ResizeArray<Struct> = new ResizeArray<Struct>() with get,set
        member val StructValue:Struct = null with get,set

    [<AllowNullLiteral>]
    type Struct() = 
        inherit Dictionary<String, Value>()

    type TagColors =
        | Magenta = 0
        | Red = 1
        | Volcano = 2
        | Orange = 3
        | Gold = 4
        | Lime = 5
        | Green = 6
        | Cyan = 7
        | Blue = 8
        | GeekBlue = 9
        | Purple = 10

    [<AllowNullLiteral>]
    type Tag() = 
        member val Id:String = null with get,set
        member val Name:String = null with get,set
        member val Color:TagColors = new TagColors() with get,set

    type SimpleSchedulingRuleTypes =
        | Always = 0
        | CustomerState = 1
        | Time = 2

    [<AllowNullLiteral>]
    type ScheduleDay() = 
        member val Offset:Int32 = new Int32() with get,set
        member val DayOfWeek:DayOfWeek = new DayOfWeek() with get,set

    type SchedulingRuleFrequency =
        | None = 0
        | Secondly = 1
        | Minutely = 2
        | Hourly = 3
        | Daily = 4
        | Weekly = 5
        | Monthly = 6
        | Yearly = 7

    [<AllowNullLiteral>]
    type SchedulingRule() = 
        member val Id:String = null with get,set
        member val Name:String = null with get,set
        member val Priority:Int32 = new Int32() with get,set
        member val State:String = null with get,set
        member val Source:String = null with get,set
        member val Condition:String = null with get,set
        member val SimpleRuleType:SimpleSchedulingRuleTypes = new SimpleSchedulingRuleTypes() with get,set
        member val CustomerState:String = null with get,set
        member val FlowId:String = null with get,set
        member val FlowParams:Struct = null with get,set
        member val IsAllDay:Boolean = new Boolean() with get,set
        member val StartDate:String = null with get,set
        member val StartTime:String = null with get,set
        member val EndTime:String = null with get,set
        member val BySetPosition:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByMonth:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByWeekNo:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByYearDay:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByMonthDay:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByDay:ResizeArray<ScheduleDay> = new ResizeArray<ScheduleDay>() with get,set
        member val ByHour:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val ByMinute:ResizeArray<Int32> = new ResizeArray<Int32>() with get,set
        member val Interval:Int32 = new Int32() with get,set
        member val Count:Int32 = new Int32() with get,set
        member val UntilDate:String = null with get,set
        member val Frequency:SchedulingRuleFrequency = new SchedulingRuleFrequency() with get,set

    [<AllowNullLiteral>]
    type Schedule() = 
        member val TimeZoneId:String = null with get,set
        member val Inherit:Boolean = new Boolean() with get,set
        member val ForceClosed:Boolean = new Boolean() with get,set
        member val Rules:ResizeArray<SchedulingRule> = new ResizeArray<SchedulingRule>() with get,set
        member val DefaultState:String = null with get,set

    [<AllowNullLiteral>]
    type IntegrationData() = 
        member val ThirdPartyId:String = null with get,set

    [<AllowNullLiteral>]
    type EntityIntegrationData() = 
        inherit Dictionary<String, IntegrationData>()

    [<AllowNullLiteral>]
    type BillingItem() = 
        member val BaseCost:Double = new Double() with get,set
        member val RawUnitMultiplier:Double = new Double() with get,set
        member val UnitCost:Double = new Double() with get,set
        member val Allowance:Int32 = new Int32() with get,set

    [<AllowNullLiteral>]
    type BillingSettings() = 
        member val Base:BillingItem = null with get,set
        member val LocalNumbers:BillingItem = null with get,set
        member val TollFreeNumbers:BillingItem = null with get,set
        member val InboundVoiceCalls:BillingItem = null with get,set
        member val OutboundVoiceCalls:BillingItem = null with get,set
        member val InboundFaxes:BillingItem = null with get,set
        member val OutboundFaxes:BillingItem = null with get,set
        member val InboundSmsMessages:BillingItem = null with get,set
        member val OutboundSmsMessages:BillingItem = null with get,set

    [<AllowNullLiteral>]
    type AppSettings() = 
        member val EnablePhoneNumberManagement:Boolean = new Boolean() with get,set
        member val EnableDeviceManagement:Boolean = new Boolean() with get,set
        member val EnableDialer:Boolean = new Boolean() with get,set
        member val EnableCallHistory:Boolean = new Boolean() with get,set
        member val ShowFileNameInMessageCenter:Boolean = new Boolean() with get,set
        member val ChakraTheme:String = null with get,set
        member val CustomCss:String = null with get,set
        member val PageTitle:String = null with get,set
        member val StringMappings:String = null with get,set
        member val LogoutUrl:String = null with get,set
        member val PortMyNumberUrl:String = null with get,set

    [<AllowNullLiteral>]
    type CustomerInfo() = 
        inherit EntityInfo()
        ///<summary>
        ///The ID of the account associated with this customer
        ///</summary>
        [<ApiMember(Description="The ID of the account associated with this customer")>]
        member val AccountId:String = null with get,set

        ///<summary>
        ///The parent customer ID for this customer
        ///</summary>
        [<ApiMember(Description="The parent customer ID for this customer")>]
        member val ParentCustomerId:String = null with get,set

        ///<summary>
        ///The breadcrumb to this customer
        ///</summary>
        [<ApiMember(Description="The breadcrumb to this customer")>]
        member val Breadcrumb:ResizeArray<CustomerBreadcrumb> = new ResizeArray<CustomerBreadcrumb>() with get,set

        ///<summary>
        ///The name of the account associated with this customer
        ///</summary>
        [<ApiMember(Description="The name of the account associated with this customer")>]
        member val AccountName:String = null with get,set

        ///<summary>
        ///Is this customer staging or production?
        ///</summary>
        [<ApiMember(Description="Is this customer staging or production?")>]
        member val IsStaging:Boolean = new Boolean() with get,set

        ///<summary>
        ///The name of the company
        ///</summary>
        [<ApiMember(Description="The name of the company")>]
        member val Name:String = null with get,set

        ///<summary>
        ///The reference ID for this company
        ///</summary>
        [<ApiMember(Description="The reference ID for this company")>]
        member val ReferenceId:String = null with get,set

        ///<summary>
        ///This customer's data values
        ///</summary>
        [<ApiMember(Description="This customer's data values")>]
        member val Data:Struct = null with get,set

        ///<summary>
        ///The list of tags for this customer
        ///</summary>
        [<ApiMember(Description="The list of tags for this customer")>]
        member val Tags:ResizeArray<Tag> = new ResizeArray<Tag>() with get,set

        ///<summary>
        ///This customer's schedule
        ///</summary>
        [<ApiMember(Description="This customer's schedule")>]
        member val Schedule:Schedule = null with get,set

        ///<summary>
        ///Integration data for this customer
        ///</summary>
        [<ApiMember(Description="Integration data for this customer")>]
        member val IntegrationData:EntityIntegrationData = null with get,set

        ///<summary>
        ///Override this customer's billing settings? Otherwise inherits from parent
        ///</summary>
        [<ApiMember(Description="Override this customer's billing settings? Otherwise inherits from parent")>]
        member val OverrideBillingSettings:Boolean = new Boolean() with get,set

        ///<summary>
        ///Billing settings for this customer
        ///</summary>
        [<ApiMember(Description="Billing settings for this customer")>]
        member val BillingSettings:BillingSettings = null with get,set

        ///<summary>
        ///Should this customer override the parent customer's app settings
        ///</summary>
        [<ApiMember(Description="Should this customer override the parent customer's app settings")>]
        member val OverrideAppSettings:Boolean = new Boolean() with get,set

        ///<summary>
        ///App / Portal settings for this customer
        ///</summary>
        [<ApiMember(Description="App / Portal settings for this customer")>]
        member val AppSettings:AppSettings = null with get,set

    ///<summary>
    ///Retrieve customers
    ///</summary>
    [<Api(Description="Retrieve customers")>]
    [<AllowNullLiteral>]
    type ListCustomers() = 
        inherit ListRequest<CustomerInfo>()
        ///<summary>
        ///Filter by accounts
        ///</summary>
        [<ApiMember(Description="Filter by accounts")>]
        member val AccountIds:ResizeArray<String> = new ResizeArray<String>() with get,set

        ///<summary>
        ///Filter by name
        ///</summary>
        [<ApiMember(Description="Filter by name")>]
        member val NameFilter:String = null with get,set

        ///<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")>]
        member val ParentCustomerIds:ResizeArray<String> = new ResizeArray<String>() with get,set

        ///<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)")>]
        member val ShallowParent:Boolean = new Boolean() with get,set

        ///<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)")>]
        member val TagIds:ResizeArray<String> = new ResizeArray<String>() with get,set

    type SortOrders =
        | Ascend = 0
        | Descend = 1

    [<AllowNullLiteral>]
    type ListRequest<'T>() = 
        interface IGet
        ///<summary>
        ///The page of data to retrieve
        ///</summary>
        [<ApiMember(Description="The page of data to retrieve")>]
        member val Page:Int32 = new Int32() with get,set

        ///<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")>]
        member val All:Boolean = new Boolean() with get,set

        ///<summary>
        ///The number per page to retrieve
        ///</summary>
        [<ApiMember(Description="The number per page to retrieve")>]
        member val CountPerPage:Int32 = new Int32() with get,set

        ///<summary>
        ///Specific IDs
        ///</summary>
        [<ApiMember(Description="Specific IDs")>]
        member val SpecificIds:ResizeArray<String> = new ResizeArray<String>() with get,set

        ///<summary>
        ///Specify a sort field
        ///</summary>
        [<ApiMember(Description="Specify a sort field")>]
        member val SortField:String = null with get,set

        ///<summary>
        ///Specify a sort order
        ///</summary>
        [<ApiMember(Description="Specify a sort order")>]
        member val SortOrder:SortOrders = new SortOrders() with get,set

        ///<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")>]
        member val SimplifiedPaging:Boolean = new Boolean() with get,set

    [<AllowNullLiteral>]
    type AccountInfo() = 
        inherit EntityInfo()
        ///<summary>
        ///The name of this account
        ///</summary>
        [<ApiMember(Description="The name of this account")>]
        member val Name:String = null with get,set

        ///<summary>
        ///The ID of this account's parent
        ///</summary>
        [<ApiMember(Description="The ID of this account's parent")>]
        member val ParentAccountId:String = null with get,set

        ///<summary>
        ///The twilio account SID
        ///</summary>
        [<ApiMember(Description="The twilio account SID")>]
        member val TwilioAccountSid:String = null with get,set

        ///<summary>
        ///The ancestors of this account. Useful for breadcrumbs
        ///</summary>
        [<ApiMember(Description="The ancestors of this account. Useful for breadcrumbs")>]
        member val AncestorIds:ResizeArray<String> = new ResizeArray<String>() with get,set

        ///<summary>
        ///The max number of phone numbers this account can have
        ///</summary>
        [<ApiMember(Description="The max number of phone numbers this account can have")>]
        member val MaxPhoneNumbers:Int32 = new Int32() with get,set

        ///<summary>
        ///This account is BYOA
        ///</summary>
        [<ApiMember(Description="This account is BYOA")>]
        member val IsBYOA:Boolean = new Boolean() with get,set

        ///<summary>
        ///TrustHub Profile Sid
        ///</summary>
        [<ApiMember(Description="TrustHub Profile Sid")>]
        member val TrustHubProfileSid:String = null with get,set

        ///<summary>
        ///The ID of the logo file
        ///</summary>
        [<ApiMember(Description="The ID of the logo file")>]
        member val LogoId:String = null with get,set

        ///<summary>
        ///The URI of the logo file
        ///</summary>
        [<ApiMember(Description="The URI of the logo file")>]
        member val LogoUri:String = null with get,set

        ///<summary>
        ///The billing settings for this account
        ///</summary>
        [<ApiMember(Description="The billing settings for this account")>]
        member val BillingSettings:BillingSettings = null with get,set

    [<AllowNullLiteral>]
    type ListResponse<AccountInfo>() = 
        ///<summary>
        ///The items
        ///</summary>
        [<ApiMember(Description="The items")>]
        member val Items:ResizeArray<AccountInfo> = new ResizeArray<AccountInfo>() with get,set

        ///<summary>
        ///The total number of items
        ///</summary>
        [<ApiMember(Description="The total number of items")>]
        member val TotalCount:Int32 = new Int32() with get,set

        ///<summary>
        ///The total number of pages
        ///</summary>
        [<ApiMember(Description="The total number of pages")>]
        member val TotalPages:Int32 = new Int32() with get,set

        ///<summary>
        ///Are there more pages of items? Used with simplified paging
        ///</summary>
        [<ApiMember(Description="Are there more pages of items? Used with simplified paging")>]
        member val HasMorePages:Boolean = new Boolean() with get,set

F# ListCustomers DTOs

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

HTTP + 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: 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,
			data: 
			{
				String: 
				{
					boolValue: False,
					stringValue: String,
					numberValue: 0,
					listValue: 
					[
						{
							String: 
							{
								boolValue: False,
								stringValue: String,
								numberValue: 0,
								listValue: 
								[
									{
										String: 
										{
											boolValue: False,
											stringValue: String,
											numberValue: 0,
											listValue: 
											[
												null
											]
										}
									}
								],
								structValue: 
								{
									String: 
									{
										boolValue: False,
										stringValue: String,
										numberValue: 0,
										listValue: 
										[
											null
										]
									}
								}
							}
						}
					],
					structValue: 
					{
						String: 
						{
							boolValue: False,
							stringValue: String,
							numberValue: 0,
							listValue: 
							[
								{
									String: 
									{
										boolValue: False,
										stringValue: String,
										numberValue: 0,
										listValue: 
										[
											null
										]
									}
								}
							],
							structValue: 
							{
								String: 
								{
									boolValue: False,
									stringValue: String,
									numberValue: 0,
									listValue: 
									[
										null
									]
								}
							}
						}
					}
				}
			},
			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,
						flowParams: 
						{
							String: 
							{
								boolValue: False,
								stringValue: String,
								numberValue: 0,
								listValue: 
								[
									{
										String: 
										{
											boolValue: False,
											stringValue: String,
											numberValue: 0,
											listValue: 
											[
												{
													String: 
													{
														boolValue: False,
														stringValue: String,
														numberValue: 0,
														listValue: 
														[
															null
														]
													}
												}
											],
											structValue: 
											{
												String: 
												{
													boolValue: False,
													stringValue: String,
													numberValue: 0,
													listValue: 
													[
														null
													]
												}
											}
										}
									}
								],
								structValue: 
								{
									String: 
									{
										boolValue: False,
										stringValue: String,
										numberValue: 0,
										listValue: 
										[
											{
												String: 
												{
													boolValue: False,
													stringValue: String,
													numberValue: 0,
													listValue: 
													[
														null
													]
												}
											}
										],
										structValue: 
										{
											String: 
											{
												boolValue: False,
												stringValue: String,
												numberValue: 0,
												listValue: 
												[
													null
												]
											}
										}
									}
								}
							}
						},
						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
				}
			},
			overrideAppSettings: False,
			appSettings: 
			{
				enablePhoneNumberManagement: False,
				enableDeviceManagement: False,
				enableDialer: False,
				enableCallHistory: 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
}