| POST | /api/documents/number |
|---|
import 'package:servicestack/servicestack.dart';
import 'dart:typed_data';
class Document implements ICustomProperties, IConvertible
{
String? ID;
String? RootDocumentID;
String? RegistrationprofileID;
String? Title;
String? FullTitle;
String? Number;
String? Version;
String? ExternalNumber;
String? ExternalVersion;
String? InternalNumber;
String? InternalInvoiceNumber;
int? PersonID;
int? RelationID;
String? RelationTitle;
int? ProjectID;
String? ProjectTitle;
String? Extension;
DateTime? Date;
int? CommentsCount;
bool? HasComments;
bool? HasPreview;
String? ExtraField;
bool? IsFavorite;
String? DocumentcategoryText;
int? FileSize;
DateTime? FileDate;
String? Hash;
String? HashType;
String? FileUrl;
String? StandardDocumentUrl;
bool? IsCorporateIdentity;
String? UserTitle;
bool? IsFrozen;
int? InternalCompanyID;
String? DirectUrl;
bool? AllowDigitalSigningOnlyOnPrimaryVersions;
bool? IsPrimaryVersion;
String? FileExtension;
Map<String,dynamic?>? CustomProperties;
Document({this.ID,this.RootDocumentID,this.RegistrationprofileID,this.Title,this.FullTitle,this.Number,this.Version,this.ExternalNumber,this.ExternalVersion,this.InternalNumber,this.InternalInvoiceNumber,this.PersonID,this.RelationID,this.RelationTitle,this.ProjectID,this.ProjectTitle,this.Extension,this.Date,this.CommentsCount,this.HasComments,this.HasPreview,this.ExtraField,this.IsFavorite,this.DocumentcategoryText,this.FileSize,this.FileDate,this.Hash,this.HashType,this.FileUrl,this.StandardDocumentUrl,this.IsCorporateIdentity,this.UserTitle,this.IsFrozen,this.InternalCompanyID,this.DirectUrl,this.AllowDigitalSigningOnlyOnPrimaryVersions,this.IsPrimaryVersion,this.FileExtension,this.CustomProperties});
Document.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
ID = json['ID'];
RootDocumentID = json['RootDocumentID'];
RegistrationprofileID = json['RegistrationprofileID'];
Title = json['Title'];
FullTitle = json['FullTitle'];
Number = json['Number'];
Version = json['Version'];
ExternalNumber = json['ExternalNumber'];
ExternalVersion = json['ExternalVersion'];
InternalNumber = json['InternalNumber'];
InternalInvoiceNumber = json['InternalInvoiceNumber'];
PersonID = json['PersonID'];
RelationID = json['RelationID'];
RelationTitle = json['RelationTitle'];
ProjectID = json['ProjectID'];
ProjectTitle = json['ProjectTitle'];
Extension = json['Extension'];
Date = JsonConverters.fromJson(json['Date'],'DateTime',context!);
CommentsCount = json['CommentsCount'];
HasComments = json['HasComments'];
HasPreview = json['HasPreview'];
ExtraField = json['ExtraField'];
IsFavorite = json['IsFavorite'];
DocumentcategoryText = json['DocumentcategoryText'];
FileSize = json['FileSize'];
FileDate = JsonConverters.fromJson(json['FileDate'],'DateTime',context!);
Hash = json['Hash'];
HashType = json['HashType'];
FileUrl = json['FileUrl'];
StandardDocumentUrl = json['StandardDocumentUrl'];
IsCorporateIdentity = json['IsCorporateIdentity'];
UserTitle = json['UserTitle'];
IsFrozen = json['IsFrozen'];
InternalCompanyID = json['InternalCompanyID'];
DirectUrl = json['DirectUrl'];
AllowDigitalSigningOnlyOnPrimaryVersions = json['AllowDigitalSigningOnlyOnPrimaryVersions'];
IsPrimaryVersion = json['IsPrimaryVersion'];
FileExtension = json['FileExtension'];
CustomProperties = JsonConverters.fromJson(json['CustomProperties'],'Map<String,dynamic?>',context!);
return this;
}
Map<String, dynamic> toJson() => {
'ID': ID,
'RootDocumentID': RootDocumentID,
'RegistrationprofileID': RegistrationprofileID,
'Title': Title,
'FullTitle': FullTitle,
'Number': Number,
'Version': Version,
'ExternalNumber': ExternalNumber,
'ExternalVersion': ExternalVersion,
'InternalNumber': InternalNumber,
'InternalInvoiceNumber': InternalInvoiceNumber,
'PersonID': PersonID,
'RelationID': RelationID,
'RelationTitle': RelationTitle,
'ProjectID': ProjectID,
'ProjectTitle': ProjectTitle,
'Extension': Extension,
'Date': JsonConverters.toJson(Date,'DateTime',context!),
'CommentsCount': CommentsCount,
'HasComments': HasComments,
'HasPreview': HasPreview,
'ExtraField': ExtraField,
'IsFavorite': IsFavorite,
'DocumentcategoryText': DocumentcategoryText,
'FileSize': FileSize,
'FileDate': JsonConverters.toJson(FileDate,'DateTime',context!),
'Hash': Hash,
'HashType': HashType,
'FileUrl': FileUrl,
'StandardDocumentUrl': StandardDocumentUrl,
'IsCorporateIdentity': IsCorporateIdentity,
'UserTitle': UserTitle,
'IsFrozen': IsFrozen,
'InternalCompanyID': InternalCompanyID,
'DirectUrl': DirectUrl,
'AllowDigitalSigningOnlyOnPrimaryVersions': AllowDigitalSigningOnlyOnPrimaryVersions,
'IsPrimaryVersion': IsPrimaryVersion,
'FileExtension': FileExtension,
'CustomProperties': JsonConverters.toJson(CustomProperties,'Map<String,dynamic?>',context!)
};
getTypeName() => "Document";
TypeContext? context = _ctx;
}
/**
* Get the details of a document by reference number
*/
// @Api(Description="Get the details of a document by reference number")
class GetDocumentByNumber implements IConvertible
{
String? Number;
String? Version;
GetDocumentByNumber({this.Number,this.Version});
GetDocumentByNumber.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
Number = json['Number'];
Version = json['Version'];
return this;
}
Map<String, dynamic> toJson() => {
'Number': Number,
'Version': Version
};
getTypeName() => "GetDocumentByNumber";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'doapigw.baasbv.nl', types: <String, TypeInfo> {
'Document': TypeInfo(TypeOf.Class, create:() => Document()),
'Map<String,dynamic?>': TypeInfo(TypeOf.Class, create:() => Map<String,dynamic?>()),
'GetDocumentByNumber': TypeInfo(TypeOf.Class, create:() => GetDocumentByNumber()),
});
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 /api/documents/number HTTP/1.1
Host: doapigw.baasbv.nl
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<GetDocumentByNumber xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document.Operations">
<Number>String</Number>
<Version>String</Version>
</GetDocumentByNumber>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<Document xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/IDB.API.DTO.Document">
<AllowDigitalSigningOnlyOnPrimaryVersions>false</AllowDigitalSigningOnlyOnPrimaryVersions>
<CommentsCount>0</CommentsCount>
<CustomProperties xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringanyType>
<d2p1:Key>String</d2p1:Key>
<d2p1:Value />
</d2p1:KeyValueOfstringanyType>
</CustomProperties>
<Date>0001-01-01T00:00:00</Date>
<DirectUrl>String</DirectUrl>
<DocumentcategoryText>String</DocumentcategoryText>
<Extension>String</Extension>
<ExternalNumber>String</ExternalNumber>
<ExternalVersion>String</ExternalVersion>
<ExtraField>String</ExtraField>
<FileDate>0001-01-01T00:00:00</FileDate>
<FileExtension>String</FileExtension>
<FileSize>0</FileSize>
<FileUrl>String</FileUrl>
<FullTitle>String</FullTitle>
<HasPreview>false</HasPreview>
<Hash>String</Hash>
<HashType>String</HashType>
<ID>00000000-0000-0000-0000-000000000000</ID>
<InternalCompanyID>0</InternalCompanyID>
<InternalInvoiceNumber>String</InternalInvoiceNumber>
<InternalNumber>String</InternalNumber>
<IsCorporateIdentity>false</IsCorporateIdentity>
<IsFavorite>false</IsFavorite>
<IsFrozen>false</IsFrozen>
<IsPrimaryVersion>false</IsPrimaryVersion>
<Number>String</Number>
<PersonID>0</PersonID>
<ProjectID>0</ProjectID>
<ProjectTitle>String</ProjectTitle>
<RegistrationprofileID>00000000-0000-0000-0000-000000000000</RegistrationprofileID>
<RelationID>0</RelationID>
<RelationTitle>String</RelationTitle>
<RootDocumentID>00000000-0000-0000-0000-000000000000</RootDocumentID>
<StandardDocumentUrl>String</StandardDocumentUrl>
<Title>String</Title>
<UserTitle>String</UserTitle>
<Version>String</Version>
</Document>