BokaMera.API.Host

<back to all web services

ExportReport

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
GET/bookings/{BookingId}/reports/{ReportId}Get a report as a PDF fileGet a PDF report.
import 'package:servicestack/servicestack.dart';

enum SendReceiptMethod
{
    Email,
    PdfExport,
}

// @ValidateRequest(Validator="IsAuthenticated")
class ExportReport implements IConvertible
{
    /**
    * Id of the booking
    */
    // @ApiMember(Description="Id of the booking", IsRequired=true, ParameterType="path")
    int? BookingId;

    /**
    * 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;

    /**
    * Id of the report
    */
    // @ApiMember(Description="Id of the report", IsRequired=true, ParameterType="path")
    int? ReportId;

    SendReceiptMethod? SendReceiptMethod;

    ExportReport({this.BookingId,this.CompanyId,this.ReportId,this.SendReceiptMethod});
    ExportReport.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        BookingId = json['BookingId'];
        CompanyId = json['CompanyId'];
        ReportId = json['ReportId'];
        SendReceiptMethod = JsonConverters.fromJson(json['SendReceiptMethod'],'SendReceiptMethod',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'BookingId': BookingId,
        'CompanyId': CompanyId,
        'ReportId': ReportId,
        'SendReceiptMethod': JsonConverters.toJson(SendReceiptMethod,'SendReceiptMethod',context!)
    };

    getTypeName() => "ExportReport";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'testapi.bokamera.se', types: <String, TypeInfo> {
    'SendReceiptMethod': TypeInfo(TypeOf.Enum, enumValues:SendReceiptMethod.values),
    'ExportReport': TypeInfo(TypeOf.Class, create:() => ExportReport()),
});

Dart ExportReport DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /bookings/{BookingId}/reports/{ReportId} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<z:anyType xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/" />