Requires any of the roles: | SystemAdministrator, Manager, Customer |
GET | /customers |
---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Voice.Api.Customers;
using Voice.Api;
using Voice.Api.Flows.Data;
using Voice.Api.Settings;
using Voice.Api.Scheduling;
using Voice.Api.Integrations;
using Voice.Api.Accounts;
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; }
}
public partial class ListRequest<T>
: IGet
{
///<summary>
///The page of data to retrieve
///</summary>
[ApiMember(Description="The page of data to retrieve")]
public virtual int Page { 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")]
public virtual bool All { get; set; }
///<summary>
///The number per page to retrieve
///</summary>
[ApiMember(Description="The number per page to retrieve")]
public virtual int CountPerPage { get; set; }
///<summary>
///Specific IDs
///</summary>
[ApiMember(Description="Specific IDs")]
public virtual List<string> SpecificIds { get; set; }
///<summary>
///Specify a sort field
///</summary>
[ApiMember(Description="Specify a sort field")]
public virtual string SortField { get; set; }
///<summary>
///Specify a sort order
///</summary>
[ApiMember(Description="Specify a sort order")]
public virtual SortOrders SortOrder { 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")]
public virtual bool SimplifiedPaging { get; set; }
}
public partial class ListResponse<T>
{
///<summary>
///The items
///</summary>
[ApiMember(Description="The items")]
public virtual List<AccountInfo> Items { get; set; }
///<summary>
///The total number of items
///</summary>
[ApiMember(Description="The total number of items")]
public virtual int TotalCount { get; set; }
///<summary>
///The total number of pages
///</summary>
[ApiMember(Description="The total number of pages")]
public virtual int TotalPages { 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")]
public virtual bool HasMorePages { get; set; }
}
public enum SortOrders
{
Ascend,
Descend,
}
}
namespace Voice.Api.Accounts
{
public partial class AccountInfo
: EntityInfo
{
///<summary>
///The name of this account
///</summary>
[ApiMember(Description="The name of this account")]
public virtual string Name { get; set; }
///<summary>
///The ID of this account's parent
///</summary>
[ApiMember(Description="The ID of this account's parent")]
public virtual string ParentAccountId { get; set; }
///<summary>
///The twilio account SID
///</summary>
[ApiMember(Description="The twilio account SID")]
public virtual string TwilioAccountSid { get; set; }
///<summary>
///The ancestors of this account. Useful for breadcrumbs
///</summary>
[ApiMember(Description="The ancestors of this account. Useful for breadcrumbs")]
public virtual List<string> AncestorIds { 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")]
public virtual int MaxPhoneNumbers { get; set; }
///<summary>
///This account is BYOA
///</summary>
[ApiMember(Description="This account is BYOA")]
public virtual bool IsBYOA { get; set; }
///<summary>
///TrustHub Profile Sid
///</summary>
[ApiMember(Description="TrustHub Profile Sid")]
public virtual string TrustHubProfileSid { get; set; }
///<summary>
///The ID of the logo file
///</summary>
[ApiMember(Description="The ID of the logo file")]
public virtual string LogoId { get; set; }
///<summary>
///The URI of the logo file
///</summary>
[ApiMember(Description="The URI of the logo file")]
public virtual string LogoUri { get; set; }
///<summary>
///The billing settings for this account
///</summary>
[ApiMember(Description="The billing settings for this account")]
public virtual BillingSettings BillingSettings { get; set; }
}
public partial class BillingItem
{
public virtual double BaseCost { get; set; }
public virtual double RawUnitMultiplier { get; set; }
public virtual double UnitCost { get; set; }
public virtual int Allowance { get; set; }
}
public partial class BillingSettings
{
public virtual BillingItem Base { get; set; }
public virtual BillingItem LocalNumbers { get; set; }
public virtual BillingItem TollFreeNumbers { get; set; }
public virtual BillingItem InboundVoiceCalls { get; set; }
public virtual BillingItem OutboundVoiceCalls { get; set; }
public virtual BillingItem InboundFaxes { get; set; }
public virtual BillingItem OutboundFaxes { get; set; }
public virtual BillingItem InboundSmsMessages { get; set; }
public virtual BillingItem OutboundSmsMessages { get; set; }
public virtual BillingItem AIInsights { get; set; }
public virtual BillingItem AILiveMinutes { get; set; }
}
}
namespace Voice.Api.Customers
{
public partial class AppSettings
{
public virtual bool EnablePhoneNumberManagement { get; set; }
public virtual bool EnableDeviceManagement { get; set; }
public virtual bool EnableDialer { get; set; }
public virtual bool EnableCallHistory { get; set; }
public virtual bool EnableAssistants { get; set; }
public virtual bool ShowFileNameInMessageCenter { get; set; }
public virtual string ChakraTheme { get; set; }
public virtual string CustomCss { get; set; }
public virtual string PageTitle { get; set; }
public virtual string StringMappings { get; set; }
public virtual string LogoutUrl { get; set; }
public virtual string PortMyNumberUrl { get; set; }
}
public partial class CustomerBreadcrumb
{
public virtual string Id { get; set; }
public virtual string Name { get; set; }
}
public partial class CustomerInfo
: EntityInfo
{
///<summary>
///The ID of the account associated with this customer
///</summary>
[ApiMember(Description="The ID of the account associated with this customer")]
public virtual string AccountId { get; set; }
///<summary>
///The parent customer ID for this customer
///</summary>
[ApiMember(Description="The parent customer ID for this customer")]
public virtual string ParentCustomerId { get; set; }
///<summary>
///The breadcrumb to this customer
///</summary>
[ApiMember(Description="The breadcrumb to this customer")]
public virtual List<CustomerBreadcrumb> Breadcrumb { get; set; }
///<summary>
///The name of the account associated with this customer
///</summary>
[ApiMember(Description="The name of the account associated with this customer")]
public virtual string AccountName { get; set; }
///<summary>
///Is this customer staging or production?
///</summary>
[ApiMember(Description="Is this customer staging or production?")]
public virtual bool IsStaging { get; set; }
///<summary>
///The name of the company
///</summary>
[ApiMember(Description="The name of the company")]
public virtual string Name { get; set; }
///<summary>
///The reference ID for this company
///</summary>
[ApiMember(Description="The reference ID for this company")]
public virtual string ReferenceId { get; set; }
///<summary>
///This customer's data values
///</summary>
[ApiMember(Description="This customer's data values")]
public virtual Struct Data { get; set; }
///<summary>
///The list of tags for this customer
///</summary>
[ApiMember(Description="The list of tags for this customer")]
public virtual List<Tag> Tags { get; set; }
///<summary>
///This customer's schedule
///</summary>
[ApiMember(Description="This customer's schedule")]
public virtual Schedule Schedule { get; set; }
///<summary>
///Integration data for this customer
///</summary>
[ApiMember(Description="Integration data for this customer")]
public virtual EntityIntegrationData IntegrationData { 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")]
public virtual bool OverrideBillingSettings { get; set; }
///<summary>
///Billing settings for this customer
///</summary>
[ApiMember(Description="Billing settings for this customer")]
public virtual BillingSettings BillingSettings { 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")]
public virtual bool OverrideAppSettings { get; set; }
///<summary>
///App / Portal settings for this customer
///</summary>
[ApiMember(Description="App / Portal settings for this customer")]
public virtual AppSettings AppSettings { get; set; }
}
///<summary>
///Retrieve customers
///</summary>
[Api(Description="Retrieve customers")]
public partial class ListCustomers
: ListRequest<CustomerInfo>
{
///<summary>
///Filter by accounts
///</summary>
[ApiMember(Description="Filter by accounts")]
public virtual List<string> AccountIds { get; set; }
///<summary>
///Filter by name
///</summary>
[ApiMember(Description="Filter by name")]
public virtual string NameFilter { 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")]
public virtual List<string> ParentCustomerIds { 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)")]
public virtual bool ShallowParent { 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)")]
public virtual List<string> TagIds { get; set; }
}
}
namespace Voice.Api.Flows.Data
{
public partial class Struct
: Dictionary<string, Value>
{
}
public partial class Value
{
public virtual bool? BoolValue { get; set; }
public virtual string StringValue { get; set; }
public virtual double? NumberValue { get; set; }
public virtual List<Struct> ListValue { get; set; }
public virtual Struct StructValue { get; set; }
}
}
namespace Voice.Api.Integrations
{
public partial class EntityIntegrationData
: Dictionary<string, IntegrationData>
{
}
public partial class IntegrationData
{
public virtual string ThirdPartyId { get; set; }
}
}
namespace Voice.Api.Scheduling
{
public partial class Schedule
{
public virtual string TimeZoneId { get; set; }
public virtual bool Inherit { get; set; }
public virtual bool ForceClosed { get; set; }
public virtual List<SchedulingRule> Rules { get; set; }
public virtual string DefaultState { get; set; }
}
public partial class ScheduleDay
{
public virtual int Offset { get; set; }
public virtual DayOfWeek DayOfWeek { get; set; }
}
public partial class SchedulingRule
{
public virtual string Id { get; set; }
public virtual string Name { get; set; }
public virtual int Priority { get; set; }
public virtual string State { get; set; }
public virtual string Source { get; set; }
public virtual string Condition { get; set; }
public virtual SimpleSchedulingRuleTypes SimpleRuleType { get; set; }
public virtual string CustomerState { get; set; }
public virtual string FlowId { get; set; }
public virtual Struct FlowParams { get; set; }
public virtual bool IsAllDay { get; set; }
public virtual string StartDate { get; set; }
public virtual string StartTime { get; set; }
public virtual string EndTime { get; set; }
public virtual List<int> BySetPosition { get; set; }
public virtual List<int> ByMonth { get; set; }
public virtual List<int> ByWeekNo { get; set; }
public virtual List<int> ByYearDay { get; set; }
public virtual List<int> ByMonthDay { get; set; }
public virtual List<ScheduleDay> ByDay { get; set; }
public virtual List<int> ByHour { get; set; }
public virtual List<int> ByMinute { get; set; }
public virtual int Interval { get; set; }
public virtual int Count { get; set; }
public virtual string UntilDate { get; set; }
public virtual SchedulingRuleFrequency Frequency { get; set; }
}
public enum SchedulingRuleFrequency
{
None,
Secondly,
Minutely,
Hourly,
Daily,
Weekly,
Monthly,
Yearly,
}
public enum SimpleSchedulingRuleTypes
{
Always,
CustomerState,
Time,
}
}
namespace Voice.Api.Settings
{
public partial class Tag
{
public virtual string Id { get; set; }
public virtual string Name { get; set; }
public virtual TagColors Color { get; set; }
}
public enum TagColors
{
Magenta,
Red,
Volcano,
Orange,
Gold,
Lime,
Green,
Cyan,
Blue,
GeekBlue,
Purple,
}
}
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 }