| Requires any of the roles: | Agent, Administrator |
| GET,PUT,DELETE,OPTIONS | /v1/Attachment/{AttachmentId} | ||
|---|---|---|---|
| POST,OPTIONS | /v1/Attachment/{TableName}/{FieldName}/{RecordId}/{NeedsOCR} | ||
| POST,OPTIONS | /v1/Attachment/{TableName}/{FieldName}/{RecordId} |
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 AttachmentRequest
{
public Attachment: Attachment[] = [];
public AttachmentId: string;
public TableName: string;
public FieldName: string;
public RecordId: number;
public NeedsOCR: boolean;
public constructor(init?: Partial<AttachmentRequest>) { (Object as any).assign(this, init); }
}
TypeScript AttachmentRequest DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=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"}]}