Trendsic Platform Service

<back to all web services

ChatRequest

Requires Authentication
Requires any of the roles:Agent, Administrator, Agent, Administrator, Agent, Administrator
The following routes are available for this service:
PUT,OPTIONS/v1/Chat/{ChatId}
GET,POST,OPTIONS/v1/Chat
Imports System
Imports System.IO
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports CRM.AgencyPlatform.API.Internal

Namespace Global

    Namespace CRM.AgencyPlatform.API.Internal

        Public Partial Class Chat
            Public Overridable Property ChatId As Guid
            Public Overridable Property ChatName As String
            Public Overridable Property CreatedBy As Guid
            Public Overridable Property DateCreated As Date
            Public Overridable Property ChatMembers As List(Of ChatMember) = New List(Of ChatMember)
            Public Overridable Property IsArchived As Boolean
            Public Overridable Property MemberCount As Integer
            Public Overridable Property MessageCount As Integer
            Public Overridable Property UnreadCount As Integer
            Public Overridable Property CreatedByName As String
        End Class

        Public Partial Class ChatMember
            Public Overridable Property ChatMemberId As Guid
            Public Overridable Property ChatId As Guid
            Public Overridable Property UserId As Guid
            Public Overridable Property IsActive As Boolean
            Public Overridable Property IsArchived As Boolean
            Public Overridable Property LastChatMessageId As Guid
            Public Overridable Property ChatMemberName As String
        End Class

        Public Partial Class ChatRequest
            Public Overridable Property ChatId As Guid
            Public Overridable Property Chat As Chat
        End Class

        Public Partial Class ChatResponse
            Public Overridable Property ResponseStatus As ResponseStatus
            Public Overridable Property Chat As List(Of Chat) = New List(Of Chat)
        End Class
    End Namespace
End Namespace

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

POST /v1/Chat HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ChatId: 00000000000000000000000000000000,
	Chat: 
	{
		ChatId: 00000000000000000000000000000000,
		ChatName: String,
		CreatedBy: 00000000000000000000000000000000,
		DateCreated: 0001-01-01,
		ChatMembers: 
		[
			{
				ChatMemberId: 00000000000000000000000000000000,
				ChatId: 00000000000000000000000000000000,
				UserId: 00000000000000000000000000000000,
				IsActive: False,
				IsArchived: False,
				LastChatMessageId: 00000000000000000000000000000000,
				ChatMemberName: String
			}
		],
		IsArchived: False,
		MemberCount: 0,
		MessageCount: 0,
		UnreadCount: 0,
		CreatedByName: String
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	},
	Chat: 
	[
		{
			ChatId: 00000000000000000000000000000000,
			ChatName: String,
			CreatedBy: 00000000000000000000000000000000,
			DateCreated: 0001-01-01,
			ChatMembers: 
			[
				{
					ChatMemberId: 00000000000000000000000000000000,
					ChatId: 00000000000000000000000000000000,
					UserId: 00000000000000000000000000000000,
					IsActive: False,
					IsArchived: False,
					LastChatMessageId: 00000000000000000000000000000000,
					ChatMemberName: String
				}
			],
			IsArchived: False,
			MemberCount: 0,
			MessageCount: 0,
			UnreadCount: 0,
			CreatedByName: String
		}
	]
}