Trendsic Platform Service

<back to all web services

AttachmentRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,PUT,DELETE,OPTIONS/v1/Attachment/{AttachmentId}
POST,OPTIONS/v1/Attachment/{TableName}/{FieldName}/{RecordId}/{NeedsOCR}
POST,OPTIONS/v1/Attachment/{TableName}/{FieldName}/{RecordId}
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using CRM.AgencyPlatform.API.Internal;

namespace CRM.AgencyPlatform.API.Internal
{
    public partial class Attachment
    {
        public virtual Guid AttachmentId { get; set; }
        public virtual string TableName { get; set; }
        public virtual string FieldName { get; set; }
        public virtual int RecordId { get; set; }
        public virtual string AttachmentName { get; set; }
        public virtual string MimeType { get; set; }
        public virtual byte[] AttachmentData { get; set; } = [];
        public virtual double FileSizeInKB { get; set; }
        public virtual DateTime CreatedDate { get; set; }
        public virtual string CreatedBy { get; set; }
        public virtual bool NeedsOCR { get; set; }
        public virtual DateTime OCRDate { get; set; }
        public virtual bool IsSecurities { get; set; }
        public virtual string AWSKey { get; set; }
        public virtual string PresignedUrl { get; set; }
    }

    public partial class AttachmentRequest
    {
        public virtual List<Attachment> Attachment { get; set; } = [];
        public virtual Guid AttachmentId { get; set; }
        public virtual string TableName { get; set; }
        public virtual string FieldName { get; set; }
        public virtual int RecordId { get; set; }
        public virtual bool NeedsOCR { get; set; }
    }

    public partial class AttachmentResponse
    {
        public virtual ResponseStatus ResponseStatus { get; set; }
        public virtual List<Attachment> Attachment { get; set; } = [];
    }

}

C# AttachmentRequest 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/Attachment/{TableName}/{FieldName}/{RecordId}/{NeedsOCR} 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: 0,
	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
		}
	]
}