Trendsic Platform Service

<back to all web services

AttachmentVersionRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,POST,OPTIONS/v1/AttachmentVersion/{AttachmentId}
namespace CRM.AgencyPlatform.API.Internal

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

    [<AllowNullLiteral>]
    type AttachmentVersion() = 
        member val AttachmentVersionId:Int32 = new Int32() with get,set
        member val AttachmentId:Guid = new Guid() with get,set
        member val VersionNo:Int32 = new Int32() with get,set
        member val AttachmentName:String = null with get,set
        member val MimeType:String = null with get,set
        member val FileSizeInKB:Nullable<Double> = new Nullable<Double>() with get,set
        member val AWSKey:String = null with get,set
        member val RevisionLabel:String = null with get,set
        member val Notes:String = null with get,set
        member val RestoredFromVersionNo:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val UploadedBy:String = null with get,set
        member val UploadedAt:Nullable<DateTime> = new Nullable<DateTime>() with get,set
        member val IsCurrent:Boolean = new Boolean() with get,set
        member val DownloadUrl:String = null with get,set

    [<AllowNullLiteral>]
    type Attachment() = 
        member val AttachmentId:Guid = new Guid() with get,set
        member val TableName:String = null with get,set
        member val FieldName:String = null with get,set
        member val RecordId:Int32 = new Int32() with get,set
        member val AttachmentName:String = null with get,set
        member val MimeType:String = null with get,set
        member val AttachmentData:Byte[] = [||] with get,set
        member val FileSizeInKB:Double = new Double() with get,set
        member val CreatedDate:DateTime = new DateTime() with get,set
        member val CreatedBy:String = null with get,set
        member val NeedsOCR:Boolean = new Boolean() with get,set
        member val OCRDate:DateTime = new DateTime() with get,set
        member val IsSecurities:Boolean = new Boolean() with get,set
        member val AWSKey:String = null with get,set
        member val PresignedUrl:String = null with get,set

    [<AllowNullLiteral>]
    type AttachmentVersionResponse() = 
        member val ResponseStatus:ResponseStatus = null with get,set
        member val AttachmentId:Guid = new Guid() with get,set
        member val Versions:ResizeArray<AttachmentVersion> = new ResizeArray<AttachmentVersion>() with get,set
        member val CurrentVersionNo:Int32 = new Int32() with get,set
        member val Head:Attachment = null with get,set

    [<AllowNullLiteral>]
    type AttachmentVersionRequest() = 
        member val AttachmentId:Guid = new Guid() with get,set
        member val RevisionLabel:String = null with get,set
        member val Notes:String = null with get,set

F# AttachmentVersionRequest 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/AttachmentVersion/{AttachmentId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	AttachmentId: 00000000000000000000000000000000,
	RevisionLabel: String,
	Notes: 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
		}
	},
	AttachmentId: 00000000000000000000000000000000,
	Versions: 
	[
		{
			AttachmentVersionId: 0,
			AttachmentId: 00000000000000000000000000000000,
			VersionNo: 0,
			AttachmentName: String,
			MimeType: String,
			FileSizeInKB: 0,
			AWSKey: String,
			RevisionLabel: String,
			Notes: String,
			RestoredFromVersionNo: 0,
			UploadedBy: String,
			UploadedAt: 0001-01-01,
			IsCurrent: False,
			DownloadUrl: String
		}
	],
	CurrentVersionNo: 0,
	Head: 
	{
		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
	}
}