| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/AttachmentVersion/{AttachmentId}/{VersionNo}/restore |
|---|
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 AttachmentVersion
Public Overridable Property AttachmentVersionId As Integer
Public Overridable Property AttachmentId As Guid
Public Overridable Property VersionNo As Integer
Public Overridable Property AttachmentName As String
Public Overridable Property MimeType As String
Public Overridable Property FileSizeInKB As Double?
Public Overridable Property AWSKey As String
Public Overridable Property RevisionLabel As String
Public Overridable Property Notes As String
Public Overridable Property RestoredFromVersionNo As Integer?
Public Overridable Property UploadedBy As String
Public Overridable Property UploadedAt As Date?
Public Overridable Property IsCurrent As Boolean
Public Overridable Property DownloadUrl As String
End Class
Public Partial Class AttachmentVersionResponse
Public Overridable Property ResponseStatus As ResponseStatus
Public Overridable Property AttachmentId As Guid
Public Overridable Property Versions As List(Of AttachmentVersion) = New List(Of AttachmentVersion)
Public Overridable Property CurrentVersionNo As Integer
Public Overridable Property Head As Attachment
End Class
Public Partial Class AttachmentVersionRestoreRequest
Public Overridable Property AttachmentId As Guid
Public Overridable Property VersionNo As Integer
Public Overridable Property Notes As String
End Class
End Namespace
End Namespace
VB.NET AttachmentVersionRestoreRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/AttachmentVersion/{AttachmentId}/{VersionNo}/restore HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
AttachmentId: 00000000000000000000000000000000,
VersionNo: 0,
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
}
}