| Requires any of the roles: | Agent, Administrator |
| POST,OPTIONS | /v1/AttachmentVersion/{AttachmentId}/{VersionNo}/restore |
|---|
export class AttachmentVersion
{
public AttachmentVersionId: number;
public AttachmentId: string;
public VersionNo: number;
public AttachmentName: string;
public MimeType: string;
public FileSizeInKB?: number;
public AWSKey: string;
public RevisionLabel: string;
public Notes: string;
public RestoredFromVersionNo?: number;
public UploadedBy: string;
public UploadedAt?: string;
public IsCurrent: boolean;
public DownloadUrl: string;
public constructor(init?: Partial<AttachmentVersion>) { (Object as any).assign(this, init); }
}
export class Attachment
{
public AttachmentId: string;
public TableName: string;
public FieldName: string;
public RecordId: number;
public AttachmentName: string;
public MimeType: string;
public AttachmentData: string = [];
public FileSizeInKB: number;
public CreatedDate: string;
public CreatedBy: string;
public NeedsOCR: boolean;
public OCRDate: string;
public IsSecurities: boolean;
public AWSKey: string;
public PresignedUrl: string;
public constructor(init?: Partial<Attachment>) { (Object as any).assign(this, init); }
}
export class AttachmentVersionResponse
{
public ResponseStatus: ResponseStatus;
public AttachmentId: string;
public Versions: AttachmentVersion[] = [];
public CurrentVersionNo: number;
public Head: Attachment;
public constructor(init?: Partial<AttachmentVersionResponse>) { (Object as any).assign(this, init); }
}
export class AttachmentVersionRestoreRequest
{
public AttachmentId: string;
public VersionNo: number;
public Notes: string;
public constructor(init?: Partial<AttachmentVersionRestoreRequest>) { (Object as any).assign(this, init); }
}
TypeScript 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
}
}