| POST,OPTIONS | /v1/Attachment/ProjectFiles/{TableName}/{FieldName}/{RecordId} | ||
|---|---|---|---|
| POST,OPTIONS | /v1/Attachment/ProjectFiles/{TableName}/{FieldName}/{RecordId}/{NeedsOCR} |
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 AttachmentResponse
{
public ResponseStatus: ResponseStatus;
public Attachment: Attachment[] = [];
public constructor(init?: Partial<AttachmentResponse>) { (Object as any).assign(this, init); }
}
export class ProjectAttachmentRequest
{
public Attachment: Attachment[] = [];
public AttachmentId: string;
public TableName: string;
public FieldName: string;
public RecordId: number;
public NeedsOCR: boolean;
public constructor(init?: Partial<ProjectAttachmentRequest>) { (Object as any).assign(this, init); }
}
TypeScript ProjectAttachmentRequest 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/Attachment/ProjectFiles/{TableName}/{FieldName}/{RecordId} 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
}
]
}