BokaMera.API.Host

<back to all web services

LogIncentiveEngage

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, bookingsupplier-administrator-read
The following routes are available for this service:
POST/company/{companyId}/incentives/{incentiveId}Logs a user interaction with an incentive.
import 'package:servicestack/servicestack.dart';

enum EngagementType
{
    Read,
    Success,
    Cancelled,
    CheckLater,
}

// @ValidateRequest(Validator="IsAuthenticated")
// @ApiResponse(Description="You were unauthorized to call this service.", StatusCode=401)
class LogIncentiveEngage implements IConvertible
{
    /**
    * The id of the company. If not provided, the company associated with the authenticated user will be used.
    */
    // @ApiMember(Description="The id of the company. If not provided, the company associated with the authenticated user will be used.", IsRequired=true, ParameterType="path")
    String? CompanyId;

    /**
    * The id of the incentive.
    */
    // @ApiMember(Description="The id of the incentive.", IsRequired=true, ParameterType="path")
    int? IncentiveId;

    /**
    * Specifies the type of engagement (e.g., Read, Engaged) performed by the user on the incentive.
    */
    // @ApiMember(Description="Specifies the type of engagement (e.g., Read, Engaged) performed by the user on the incentive.", IsRequired=true)
    EngagementType? EngagementType;

    LogIncentiveEngage({this.CompanyId,this.IncentiveId,this.EngagementType});
    LogIncentiveEngage.fromJson(Map<String, dynamic> json) { fromMap(json); }

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

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

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

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

Dart LogIncentiveEngage DTOs

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

HTTP + JSV

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

POST /company/{companyId}/incentives/{incentiveId} HTTP/1.1 
Host: testapi.bokamera.se 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	IncentiveId: 0,
	EngagementType: Read
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	
}