| Requires any of the roles: | Agent, Administrator |
| POST | /v1/project/rfp/attachment |
|---|
import 'package:servicestack/servicestack.dart';
class UploadAttachmentResponse implements IConvertible
{
ResponseStatus? ResponseStatus;
String? AttachmentId;
int? ProjectId;
String? FileType;
String? FileName;
String? ContentType;
int? ContentLength;
DateTime? CreatedUtc;
UploadAttachmentResponse({this.ResponseStatus,this.AttachmentId,this.ProjectId,this.FileType,this.FileName,this.ContentType,this.ContentLength,this.CreatedUtc});
UploadAttachmentResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ResponseStatus = JsonConverters.fromJson(json['ResponseStatus'],'ResponseStatus',context!);
AttachmentId = json['AttachmentId'];
ProjectId = json['ProjectId'];
FileType = json['FileType'];
FileName = json['FileName'];
ContentType = json['ContentType'];
ContentLength = json['ContentLength'];
CreatedUtc = JsonConverters.fromJson(json['CreatedUtc'],'DateTime',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ResponseStatus': JsonConverters.toJson(ResponseStatus,'ResponseStatus',context!),
'AttachmentId': AttachmentId,
'ProjectId': ProjectId,
'FileType': FileType,
'FileName': FileName,
'ContentType': ContentType,
'ContentLength': ContentLength,
'CreatedUtc': JsonConverters.toJson(CreatedUtc,'DateTime',context!)
};
getTypeName() => "UploadAttachmentResponse";
TypeContext? context = _ctx;
}
class HttpFile implements IConvertible
{
String? Name;
String? FileName;
int? ContentLength;
String? ContentType;
Uint8List? InputStream;
HttpFile({this.Name,this.FileName,this.ContentLength,this.ContentType,this.InputStream});
HttpFile.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Name = json['Name'];
FileName = json['FileName'];
ContentLength = json['ContentLength'];
ContentType = json['ContentType'];
InputStream = JsonConverters.fromJson(json['InputStream'],'Uint8List',context!);
return this;
}
Map<String, dynamic> toJson() => {
'Name': Name,
'FileName': FileName,
'ContentLength': ContentLength,
'ContentType': ContentType,
'InputStream': JsonConverters.toJson(InputStream,'Uint8List',context!)
};
getTypeName() => "HttpFile";
TypeContext? context = _ctx;
}
class UploadRfpAttachment implements IConvertible
{
HttpFile? File;
UploadRfpAttachment({this.File});
UploadRfpAttachment.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
File = JsonConverters.fromJson(json['File'],'HttpFile',context!);
return this;
}
Map<String, dynamic> toJson() => {
'File': JsonConverters.toJson(File,'HttpFile',context!)
};
getTypeName() => "UploadRfpAttachment";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.dev.dynamics.trendsic.com', types: <String, TypeInfo> {
'UploadAttachmentResponse': TypeInfo(TypeOf.Class, create:() => UploadAttachmentResponse()),
'HttpFile': TypeInfo(TypeOf.Class, create:() => HttpFile()),
'Uint8List': TypeInfo(TypeOf.Class, create:() => Uint8List(0)),
'UploadRfpAttachment': TypeInfo(TypeOf.Class, create:() => UploadRfpAttachment()),
});
To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /v1/project/rfp/attachment HTTP/1.1
Host: api.dev.dynamics.trendsic.com
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<UploadRfpAttachment xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<File xmlns:d2p1="http://schemas.datacontract.org/2004/07/ServiceStack.Host">
<d2p1:ContentLength>0</d2p1:ContentLength>
<d2p1:ContentType>String</d2p1:ContentType>
<d2p1:FileName>String</d2p1:FileName>
<d2p1:InputStream xmlns:d3p1="http://schemas.datacontract.org/2004/07/System.IO" i:nil="true" />
<d2p1:Name>String</d2p1:Name>
</File>
</UploadRfpAttachment>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<UploadAttachmentResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CRM.AgencyPlatform.API.Internal">
<AttachmentId>String</AttachmentId>
<ContentLength>0</ContentLength>
<ContentType>String</ContentType>
<CreatedUtc>0001-01-01T00:00:00</CreatedUtc>
<FileName>String</FileName>
<FileType>String</FileType>
<ProjectId>0</ProjectId>
<ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:Message>String</d2p1:Message>
<d2p1:StackTrace>String</d2p1:StackTrace>
<d2p1:Errors>
<d2p1:ResponseError>
<d2p1:ErrorCode>String</d2p1:ErrorCode>
<d2p1:FieldName>String</d2p1:FieldName>
<d2p1:Message>String</d2p1:Message>
<d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d5p1:KeyValueOfstringstring>
<d5p1:Key>String</d5p1:Key>
<d5p1:Value>String</d5p1:Value>
</d5p1:KeyValueOfstringstring>
</d2p1:Meta>
</d2p1:ResponseError>
</d2p1:Errors>
<d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d3p1:KeyValueOfstringstring>
<d3p1:Key>String</d3p1:Key>
<d3p1:Value>String</d3p1:Value>
</d3p1:KeyValueOfstringstring>
</d2p1:Meta>
</ResponseStatus>
</UploadAttachmentResponse>