Trendsic Platform Service

<back to all web services

CRMimageRequest

Requires Authentication
Requires any of the roles:Agent, Administrator
The following routes are available for this service:
GET,POST,PUT,DELETE,OPTIONS/v1/CRMimage/{ContactId}
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 CRMimageRequest
    {
        public virtual List<Document> Document { get; set; } = [];
        public virtual int ContactId { get; set; }
        public virtual Dictionary<string, string> Fields { get; set; } = new();
    }

    public partial class Document
    {
        public virtual Guid DocumentId { get; set; }
        public virtual string DocType { get; set; }
        public virtual string DocCategory { get; set; }
        public virtual string DocSubCategory { get; set; }
        public virtual string DocTitle { get; set; }
        public virtual string DocDescription { get; set; }
        public virtual byte[] DocData { get; set; } = [];
        public virtual DateTime? DocExpiration { get; set; }
        public virtual string DocMimeType { get; set; }
        public virtual int DisplayOrder { get; set; }
        public virtual double FileSizeInKB { get; set; }
        public virtual string Link { get; set; }
        public virtual DateTime? UploadDate { get; set; }
        public virtual string DocKey { get; set; }
    }

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

}

C# CRMimageRequest 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/CRMimage/{ContactId} HTTP/1.1 
Host: api.dev.dynamics.trendsic.com 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Document: 
	[
		{
			DocumentId: 00000000000000000000000000000000,
			DocType: String,
			DocCategory: String,
			DocSubCategory: String,
			DocTitle: String,
			DocDescription: String,
			DocData: AA==,
			DocExpiration: 0001-01-01,
			DocMimeType: String,
			DisplayOrder: 0,
			FileSizeInKB: 0,
			Link: String,
			UploadDate: 0001-01-01,
			DocKey: String
		}
	],
	ContactId: 0,
	Fields: 
	{
		String: 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
		}
	},
	Document: 
	[
		{
			DocumentId: 00000000000000000000000000000000,
			DocType: String,
			DocCategory: String,
			DocSubCategory: String,
			DocTitle: String,
			DocDescription: String,
			DocData: AA==,
			DocExpiration: 0001-01-01,
			DocMimeType: String,
			DisplayOrder: 0,
			FileSizeInKB: 0,
			Link: String,
			UploadDate: 0001-01-01,
			DocKey: String
		}
	]
}