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}
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 AttachmentRequest
            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 Integer
            Public Overridable Property NeedsOCR As Boolean
        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
    End Namespace
End Namespace

VB.NET AttachmentRequest DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv

HTTP + CSV

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/csv
Content-Type: text/csv
Content-Length: length

{"Attachment":[{"AttachmentId":"00000000000000000000000000000000","TableName":"String","FieldName":"String","RecordId":0,"AttachmentName":"String","MimeType":"String","AttachmentData":"AA==","FileSizeInKB":0,"CreatedDate":"0001-01-01T00:00:00.0000000","CreatedBy":"String","NeedsOCR":false,"OCRDate":"0001-01-01T00:00:00.0000000","IsSecurities":false,"AWSKey":"String","PresignedUrl":"String"}],"AttachmentId":"00000000000000000000000000000000","TableName":"String","FieldName":"String","RecordId":0,"NeedsOCR":false}
HTTP/1.1 200 OK
Content-Type: text/csv
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-01T00:00:00.0000000","CreatedBy":"String","NeedsOCR":false,"OCRDate":"0001-01-01T00:00:00.0000000","IsSecurities":false,"AWSKey":"String","PresignedUrl":"String"}]}