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: 'api.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 .json suffix or ?format=json

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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: api.bokamera.se 
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{}