POST | /integrations |
---|
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports Voice.Api.Integrations
Imports Voice.Api
Imports Voice.Api.Customers
Imports Voice.Api.Flows.Data
Imports Voice.Api.Endpoints
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.Customers
Public Partial Class CustomerBreadcrumb
Public Overridable Property Id As String
Public Overridable Property Name As String
End Class
End Namespace
Namespace Voice.Api.Endpoints
Public Enum UserDataFieldModes
Hidden
[ReadOnly]
ReadWrite
End Enum
End Namespace
Namespace Voice.Api.Flows.Data
Public Partial Class DataField
Public Overridable Property Id As String
Public Overridable Property Name As String
Public Overridable Property Type As ValueTypes
Public Overridable Property UIHint As UIHints
Public Overridable Property UITab As String
Public Overridable Property IsAsync As Boolean
Public Overridable Property DisableBinding As Boolean
Public Overridable Property StructType As DataType
Public Overridable Property ListType As DataType
Public Overridable Property Description As String
Public Overridable Property PossibleValues As List(Of String)
Public Overridable Property IsOutput As Boolean
Public Overridable Property CustomFieldValuesUrl As String
Public Overridable Property DefaultValue As Value
Public Overridable Property TransitionNameFormat As String
Public Overridable Property Uniqueness As DataFieldUniqueness
Public Overridable Property VoiceOnly As Boolean
Public Overridable Property ConditionalVisibilityField As String
Public Overridable Property ConditionalVisibilityValue As String
Public Overridable Property NoEvalTemplate As Boolean
Public Overridable Property UserMode As UserDataFieldModes
Public Overridable Property AnyValueType As Boolean
End Class
Public Enum DataFieldUniqueness
NotUnique
Unique
UniqueToCustomer
End Enum
Public Partial Class DataType
Public Overridable Property TypeName As String
Public Overridable Property Fields As List(Of DataField)
End Class
Public Partial Class Struct
Inherits Dictionary(Of String, Value)
End Class
Public Enum UIHints
None
LargeText
InlineForm
Password
InlineStruct
End Enum
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
Public Enum ValueTypes
NotSpecified
[String]
[Boolean]
Number
List
Struct
Transition
Custom
[Date]
AudioFile
TimeZoneId
PhoneNumber
User
Endpoint
Time
File
FaxNumber
EmailAccount
Customer
Flow
Team
FlowReference
Integration
Assistant
End Enum
End Namespace
Namespace Voice.Api.Integrations
Public Enum IntegrationFeatures
CrmSync
OAuth2
End Enum
Public Partial Class IntegrationInfo
Inherits EntityInfo
'''<Summary>
'''The ID of the account associated with this integration
'''</Summary>
<ApiMember(Description:="The ID of the account associated with this integration")>
Public Overridable Property AccountId As String
'''<Summary>
'''The ID of the customer this integration is associated with
'''</Summary>
<ApiMember(Description:="The ID of the customer this integration is associated with")>
Public Overridable Property CustomerId As String
'''<Summary>
'''The name of the customer this integration is associated with
'''</Summary>
<ApiMember(Description:="The name of the customer this integration is associated with")>
Public Overridable Property CustomerName As String
'''<Summary>
'''The date the integration was sync'd last
'''</Summary>
<ApiMember(Description:="The date the integration was sync'd last")>
Public Overridable Property DateLastSync As String
'''<Summary>
'''The breadcrumb to the customer for this integration
'''</Summary>
<ApiMember(Description:="The breadcrumb to the customer for this integration")>
Public Overridable Property CustomerBreadcrumb As List(Of CustomerBreadcrumb)
'''<Summary>
'''The name of the integration (e.g. HostedSuite Dallas)
'''</Summary>
<ApiMember(Description:="The name of the integration (e.g. HostedSuite Dallas)")>
Public Overridable Property Name As String
'''<Summary>
'''Automatically create new customers / users when sync'ing with CRM?
'''</Summary>
<ApiMember(Description:="Automatically create new customers / users when sync'ing with CRM?")>
Public Overridable Property AutomaticallyCreateCustomers As Boolean
'''<Summary>
'''The type of integration
'''</Summary>
<ApiMember(Description:="The type of integration")>
Public Overridable Property Type As IntegrationTypes
'''<Summary>
'''The status of the integration
'''</Summary>
<ApiMember(Description:="The status of the integration")>
Public Overridable Property Status As IntegrationStatuses
'''<Summary>
'''The status of the integration
'''</Summary>
<ApiMember(Description:="The status of the integration")>
Public Overridable Property StatusMessage As String
'''<Summary>
'''The settings type for this integration
'''</Summary>
<ApiMember(Description:="The settings type for this integration")>
Public Overridable Property SettingsDataType As DataType
'''<Summary>
'''The settings for this integration
'''</Summary>
<ApiMember(Description:="The settings for this integration")>
Public Overridable Property Settings As Struct
'''<Summary>
'''The features supported by this integration
'''</Summary>
<ApiMember(Description:="The features supported by this integration")>
Public Overridable Property Features As List(Of IntegrationFeatures)
'''<Summary>
'''Is this integration authorized (OAuth)?
'''</Summary>
<ApiMember(Description:="Is this integration authorized (OAuth)?")>
Public Overridable Property IsAuthorized As Boolean
End Class
Public Enum IntegrationStatuses
NotConfigured
[Error]
OK
End Enum
Public Enum IntegrationTypes
HostedSuite
OfficeRnd
Zoho
End Enum
'''<Summary>
'''Creates a new integration
'''</Summary>
<Api(Description:="Creates a new integration")>
Public Partial Class NewIntegration
Implements IPost
'''<Summary>
'''The account ID to associate this integration with
'''</Summary>
<ApiMember(Description:="The account ID to associate this integration with")>
Public Overridable Property AccountId As String
'''<Summary>
'''The type of integration
'''</Summary>
<ApiMember(Description:="The type of integration")>
Public Overridable Property Type As IntegrationTypes
'''<Summary>
'''The name of the integration
'''</Summary>
<ApiMember(Description:="The name of the integration")>
Public Overridable Property Name As String
'''<Summary>
'''The parent customer for this integration
'''</Summary>
<ApiMember(Description:="The parent customer for this integration")>
Public Overridable Property CustomerId As String
End Class
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.
POST /integrations HTTP/1.1
Host: team.evovoice.io
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
accountId: String,
type: HostedSuite,
name: String,
customerId: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { accountId: String, customerId: String, customerName: String, dateLastSync: String, customerBreadcrumb: [ { id: String, name: String } ], name: String, automaticallyCreateCustomers: False, type: HostedSuite, status: NotConfigured, statusMessage: String, features: [ CrmSync ], isAuthorized: False, id: String, dateCreated: String, dateLastModified: String, createdBy: String, lastModifiedBy: String }