Trendsic Platform Service

<back to all web services

CustomerAttachmentRequest

The following routes are available for this service:
DELETE,OPTIONS/v1/CustomerAttachment/{AttachmentId}
POST,OPTIONS/v1/CustomerAttachment/{TableName}/{FieldName}/{RecordId}
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 Attachment
            Public Overridable Property AttachmentId As Guid
            Public Overridable Property TableName As String
            Public Overridable Property FieldName As String
            Public Overridable Property RecordId As Integer
            Public Overridable Property AttachmentName As String
            Public Overridable Property MimeType As String
            Public Overridable Property AttachmentData As Byte() = New Byte(){}
            Public Overridable Property FileSizeInKB As Double
            Public Overridable Property CreatedDate As Date
            Public Overridable Property CreatedBy As String
            Public Overridable Property NeedsOCR As Boolean
            Public Overridable Property OCRDate As Date
            Public Overridable Property IsSecurities As Boolean
            Public Overridable Property AWSKey As String
            Public Overridable Property PresignedUrl As String
        End Class

        Public Partial Class AttachmentResponse
            Public Overridable Property ResponseStatus As ResponseStatus
            Public Overridable Property Attachment As List(Of Attachment) = New List(Of Attachment)
        End Class

        Public Partial Class CustomerAttachmentRequest
            Public Overridable Property Attachment As List(Of Attachment) = New List(Of Attachment)
            Public Overridable Property AttachmentId As Guid
            Public Overridable Property TableName As String
            Public Overridable Property FieldName As String
            Public Overridable Property RecordId As Guid
            Public Overridable Property NeedsOCR As Boolean
        End Class
    End Namespace
End Namespace

VB.NET CustomerAttachmentRequest 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/CustomerAttachment/{TableName}/{FieldName}/{RecordId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Attachment: 
	[
		{
			AttachmentId: 00000000000000000000000000000000,
			TableName: String,
			FieldName: String,
			RecordId: 0,
			AttachmentName: String,
			MimeType: String,
			AttachmentData: AA==,
			FileSizeInKB: 0,
			CreatedDate: 0001-01-01,
			CreatedBy: String,
			NeedsOCR: False,
			OCRDate: 0001-01-01,
			IsSecurities: False,
			AWSKey: String,
			PresignedUrl: String
		}
	],
	AttachmentId: 00000000000000000000000000000000,
	TableName: String,
	FieldName: String,
	RecordId: 00000000000000000000000000000000,
	NeedsOCR: False
}
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
		}
	},
	Attachment: 
	[
		{
			AttachmentId: 00000000000000000000000000000000,
			TableName: String,
			FieldName: String,
			RecordId: 0,
			AttachmentName: String,
			MimeType: String,
			AttachmentData: AA==,
			FileSizeInKB: 0,
			CreatedDate: 0001-01-01,
			CreatedBy: String,
			NeedsOCR: False,
			OCRDate: 0001-01-01,
			IsSecurities: False,
			AWSKey: String,
			PresignedUrl: String
		}
	]
}