POST | /errors/ | Save error to log |
---|
import 'package:servicestack/servicestack.dart';
class ErrorQueryResponse implements IConvertible
{
String? CompanyId;
int? Id;
String? ExceptionName;
String? ExceptionMessage;
String? ExceptionSource;
String? InnerExceptionName;
String? StackTrace;
String? URL;
String? LoggedInUser;
bool? Visible;
String? IPAddress;
DateTime? CreatedDate;
String? Request;
String? Session;
ErrorQueryResponse({this.CompanyId,this.Id,this.ExceptionName,this.ExceptionMessage,this.ExceptionSource,this.InnerExceptionName,this.StackTrace,this.URL,this.LoggedInUser,this.Visible,this.IPAddress,this.CreatedDate,this.Request,this.Session});
ErrorQueryResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
Id = json['Id'];
ExceptionName = json['ExceptionName'];
ExceptionMessage = json['ExceptionMessage'];
ExceptionSource = json['ExceptionSource'];
InnerExceptionName = json['InnerExceptionName'];
StackTrace = json['StackTrace'];
URL = json['URL'];
LoggedInUser = json['LoggedInUser'];
Visible = json['Visible'];
IPAddress = json['IPAddress'];
CreatedDate = JsonConverters.fromJson(json['CreatedDate'],'DateTime',context!);
Request = json['Request'];
Session = json['Session'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'Id': Id,
'ExceptionName': ExceptionName,
'ExceptionMessage': ExceptionMessage,
'ExceptionSource': ExceptionSource,
'InnerExceptionName': InnerExceptionName,
'StackTrace': StackTrace,
'URL': URL,
'LoggedInUser': LoggedInUser,
'Visible': Visible,
'IPAddress': IPAddress,
'CreatedDate': JsonConverters.toJson(CreatedDate,'DateTime',context!),
'Request': Request,
'Session': Session
};
getTypeName() => "ErrorQueryResponse";
TypeContext? context = _ctx;
}
class CreateError implements ICompany, IConvertible
{
/**
* The company id, if empty will use the company id for the user you are logged in with.
*/
// @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.")
String? CompanyId;
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
String? ExceptionName;
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
String? ExceptionMessage;
/**
*
*/
// @ApiMember(Description="")
String? ExceptionSource;
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
String? InnerExceptionName;
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
String? StackTrace;
/**
*
*/
// @ApiMember(Description="", IsRequired=true)
String? URL;
/**
*
*/
// @ApiMember(Description="")
String? LoggedInUser;
/**
*
*/
// @ApiMember(Description="")
String? IPAddress;
/**
*
*/
// @ApiMember(Description="")
String? Request;
/**
*
*/
// @ApiMember(Description="")
String? Session;
CreateError({this.CompanyId,this.ExceptionName,this.ExceptionMessage,this.ExceptionSource,this.InnerExceptionName,this.StackTrace,this.URL,this.LoggedInUser,this.IPAddress,this.Request,this.Session});
CreateError.fromJson(Map<String, dynamic> json) { fromMap(json); }
fromMap(Map<String, dynamic> json) {
CompanyId = json['CompanyId'];
ExceptionName = json['ExceptionName'];
ExceptionMessage = json['ExceptionMessage'];
ExceptionSource = json['ExceptionSource'];
InnerExceptionName = json['InnerExceptionName'];
StackTrace = json['StackTrace'];
URL = json['URL'];
LoggedInUser = json['LoggedInUser'];
IPAddress = json['IPAddress'];
Request = json['Request'];
Session = json['Session'];
return this;
}
Map<String, dynamic> toJson() => {
'CompanyId': CompanyId,
'ExceptionName': ExceptionName,
'ExceptionMessage': ExceptionMessage,
'ExceptionSource': ExceptionSource,
'InnerExceptionName': InnerExceptionName,
'StackTrace': StackTrace,
'URL': URL,
'LoggedInUser': LoggedInUser,
'IPAddress': IPAddress,
'Request': Request,
'Session': Session
};
getTypeName() => "CreateError";
TypeContext? context = _ctx;
}
TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
'ErrorQueryResponse': TypeInfo(TypeOf.Class, create:() => ErrorQueryResponse()),
'CreateError': TypeInfo(TypeOf.Class, create:() => CreateError()),
});
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 /errors/ HTTP/1.1
Host: api.bokamera.se
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CreateError xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos">
<CompanyId>00000000-0000-0000-0000-000000000000</CompanyId>
<ExceptionMessage>String</ExceptionMessage>
<ExceptionName>String</ExceptionName>
<ExceptionSource>String</ExceptionSource>
<IPAddress>String</IPAddress>
<InnerExceptionName>String</InnerExceptionName>
<LoggedInUser>String</LoggedInUser>
<Request>String</Request>
<Session>String</Session>
<StackTrace>String</StackTrace>
<URL>String</URL>
</CreateError>
HTTP/1.1 200 OK Content-Type: application/xml Content-Length: length <ErrorQueryResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/BokaMera.API.ServiceModel.Dtos"> <CompanyId>00000000-0000-0000-0000-000000000000</CompanyId> <CreatedDate>0001-01-01T00:00:00</CreatedDate> <ExceptionMessage>String</ExceptionMessage> <ExceptionName>String</ExceptionName> <ExceptionSource>String</ExceptionSource> <IPAddress>String</IPAddress> <Id>0</Id> <InnerExceptionName>String</InnerExceptionName> <LoggedInUser>String</LoggedInUser> <Request>String</Request> <Session>String</Session> <StackTrace>String</StackTrace> <URL>String</URL> <Visible>false</Visible> </ErrorQueryResponse>