| Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
| GET | /webhook/endpoints/{EndpointId}/attempts | List webhook endpoint attempts |
|---|
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum
Object = TypeVar('Object')
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class WebhookMessageAttempt:
id: Optional[str] = None
message_id: Optional[str] = None
endpoint_id: Optional[str] = None
url: Optional[str] = None
status: Optional[str] = None
response_status_code: Optional[int] = None
timestamp: datetime.datetime = datetime.datetime(1, 1, 1)
trigger_type: Optional[str] = None
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ListMessageAttemptsResponse:
attempts: List[WebhookMessageAttempt] = field(default_factory=list)
done: bool = False
iterator: Optional[str] = None
# @ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)
# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class ListWebhookEndpointAttempts(ICompany):
# @ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.", IsRequired=true, ParameterType="query")
company_id: Optional[str] = None
"""
The company id, if empty will use the company id for the user you are logged in with.
"""
# @ApiMember(Description="The ID of the webhook endpoint.", IsRequired=true, ParameterType="path")
endpoint_id: Optional[str] = None
"""
The ID of the webhook endpoint.
"""
# @ApiMember(Description="Pagination iterator.")
iterator: Optional[str] = None
"""
Pagination iterator.
"""
# @ApiMember(Description="Maximum number of attempts to return.")
limit: Optional[int] = None
"""
Maximum number of attempts to return.
"""
# @ApiMember(Description="Filter by message status. 0 = Success, 1 = Pending, 2 = Fail, 3 = Sending.")
status: Optional[int] = None
"""
Filter by message status. 0 = Success, 1 = Pending, 2 = Fail, 3 = Sending.
"""
# @ApiMember(Description="Filter by event types.")
event_types: Optional[List[str]] = None
"""
Filter by event types.
"""
# @ApiMember(Description="Filter attempts before this date.")
before: Optional[datetime.datetime] = None
"""
Filter attempts before this date.
"""
# @ApiMember(Description="Filter attempts after this date.")
after: Optional[datetime.datetime] = None
"""
Filter attempts after this date.
"""
Python ListWebhookEndpointAttempts DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /webhook/endpoints/{EndpointId}/attempts HTTP/1.1
Host: api.bokamera.se
Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"Attempts":[{"Id":"String","MessageId":"String","EndpointId":"String","Url":"String","Status":"String","ResponseStatusCode":0,"TriggerType":"String"}],"Done":false,"Iterator":"String"}