BokaMera.API.Host

<back to all web services

ListWebhookMessageAttempts

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin
The following routes are available for this service:
GET/webhook/messages/{MessageId}/attemptsList webhook message attempts
import 'package:servicestack/servicestack.dart';

class WebhookMessageAttempt implements IConvertible
{
    String Id = "";
    String MessageId = "";
    String EndpointId = "";
    String Url = "";
    String Status = "";
    int? ResponseStatusCode;
    DateTime Timestamp = DateTime(0);
    String TriggerType = "";

    WebhookMessageAttempt({this.Id,this.MessageId,this.EndpointId,this.Url,this.Status,this.ResponseStatusCode,this.Timestamp,this.TriggerType});
    WebhookMessageAttempt.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Id = json['Id'];
        MessageId = json['MessageId'];
        EndpointId = json['EndpointId'];
        Url = json['Url'];
        Status = json['Status'];
        ResponseStatusCode = json['ResponseStatusCode'];
        Timestamp = JsonConverters.fromJson(json['Timestamp'],'DateTime',context!);
        TriggerType = json['TriggerType'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Id': Id,
        'MessageId': MessageId,
        'EndpointId': EndpointId,
        'Url': Url,
        'Status': Status,
        'ResponseStatusCode': ResponseStatusCode,
        'Timestamp': JsonConverters.toJson(Timestamp,'DateTime',context!),
        'TriggerType': TriggerType
    };

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

class ListMessageAttemptsResponse implements IConvertible
{
    List<WebhookMessageAttempt> Attempts = [];
    bool Done;
    String? Iterator;

    ListMessageAttemptsResponse({this.Attempts,this.Done,this.Iterator});
    ListMessageAttemptsResponse.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Attempts = JsonConverters.fromJson(json['Attempts'],'List<WebhookMessageAttempt>',context!);
        Done = json['Done'];
        Iterator = json['Iterator'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Attempts': JsonConverters.toJson(Attempts,'List<WebhookMessageAttempt>',context!),
        'Done': Done,
        'Iterator': Iterator
    };

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

// @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
// @ValidateRequest(Validator="IsAuthenticated")
class ListWebhookMessageAttempts 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.", IsRequired=true, ParameterType="query")
    String CompanyId = "";

    /**
    * The ID of the webhook message.
    */
    // @ApiMember(Description="The ID of the webhook message.", IsRequired=true, ParameterType="path")
    String MessageId = "";

    /**
    * Pagination iterator.
    */
    // @ApiMember(Description="Pagination iterator.")
    String? Iterator;

    /**
    * Maximum number of attempts to return.
    */
    // @ApiMember(Description="Maximum number of attempts to return.")
    int? Limit;

    /**
    * Filter by message status. 0 = Success, 1 = Pending, 2 = Fail, 3 = Sending.
    */
    // @ApiMember(Description="Filter by message status. 0 = Success, 1 = Pending, 2 = Fail, 3 = Sending.")
    int? Status;

    /**
    * Filter by event types.
    */
    // @ApiMember(Description="Filter by event types.")
    List<String>? EventTypes;

    /**
    * Filter by endpoint ID.
    */
    // @ApiMember(Description="Filter by endpoint ID.")
    String? EndpointId;

    /**
    * Filter attempts before this date.
    */
    // @ApiMember(Description="Filter attempts before this date.")
    DateTime? Before;

    /**
    * Filter attempts after this date.
    */
    // @ApiMember(Description="Filter attempts after this date.")
    DateTime? After;

    ListWebhookMessageAttempts({this.CompanyId,this.MessageId,this.Iterator,this.Limit,this.Status,this.EventTypes,this.EndpointId,this.Before,this.After});
    ListWebhookMessageAttempts.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        CompanyId = json['CompanyId'];
        MessageId = json['MessageId'];
        Iterator = json['Iterator'];
        Limit = json['Limit'];
        Status = json['Status'];
        EventTypes = JsonConverters.fromJson(json['EventTypes'],'List<String>',context!);
        EndpointId = json['EndpointId'];
        Before = JsonConverters.fromJson(json['Before'],'DateTime',context!);
        After = JsonConverters.fromJson(json['After'],'DateTime',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'CompanyId': CompanyId,
        'MessageId': MessageId,
        'Iterator': Iterator,
        'Limit': Limit,
        'Status': Status,
        'EventTypes': JsonConverters.toJson(EventTypes,'List<String>',context!),
        'EndpointId': EndpointId,
        'Before': JsonConverters.toJson(Before,'DateTime',context!),
        'After': JsonConverters.toJson(After,'DateTime',context!)
    };

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

TypeContext _ctx = TypeContext(library: 'api.bokamera.se', types: <String, TypeInfo> {
    'WebhookMessageAttempt': TypeInfo(TypeOf.Class, create:() => WebhookMessageAttempt()),
    'ListMessageAttemptsResponse': TypeInfo(TypeOf.Class, create:() => ListMessageAttemptsResponse()),
    'List<WebhookMessageAttempt>': TypeInfo(TypeOf.Class, create:() => <WebhookMessageAttempt>[]),
    'ListWebhookMessageAttempts': TypeInfo(TypeOf.Class, create:() => ListWebhookMessageAttempts()),
});

Dart ListWebhookMessageAttempts DTOs

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

HTTP + OTHER

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

GET /webhook/messages/{MessageId}/attempts HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsonl
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"Attempts":[{"Id":"String","MessageId":"String","EndpointId":"String","Url":"String","Status":"String","ResponseStatusCode":0,"TriggerType":"String"}],"Done":false,"Iterator":"String"}