Requires any of the roles: | bookingsupplier-administrator-write, superadmin |
GET | /webhook/messages | List webhook message |
---|
using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using BokaMera.API.ServiceModel.Dtos;
using Webhook.Service.External.Models.Models;
namespace BokaMera.API.ServiceModel.Dtos
{
[ApiResponse(Description="You were unauthorized to call this service", StatusCode=401)]
[ValidateRequest("IsAuthenticated")]
public partial class ListWebhookMessages
: ListMessagesRequestDto, ICompany
{
///<summary>
///The company id, if empty will use the company id for the user you are logged in with.
///</summary>
[ApiMember(Description="The company id, if empty will use the company id for the user you are logged in with.", IsRequired=true, ParameterType="query")]
public virtual Guid? CompanyId { get; set; }
}
}
namespace Webhook.Service.External.Models.Models
{
public partial class ClientWebhookRequestBase
{
public virtual Guid ClientId { get; set; }
}
public partial class GetMessageResponseDto
{
public GetMessageResponseDto()
{
Channels = new List<string>{};
Metadata = new Dictionary<string, string>{};
}
public virtual string Id { get; set; }
public virtual List<string> Channels { get; set; }
public virtual string EventType { get; set; }
public virtual Dictionary<string, string> Metadata { get; set; }
public virtual Object Payload { get; set; }
public virtual string EventId { get; set; }
public virtual DateTime Timestamp { get; set; }
}
public partial class ListMessagesRequestDto
: ClientWebhookRequestBase
{
public ListMessagesRequestDto()
{
EventTypes = new List<string>{};
}
public virtual DateTime? Before { get; set; }
public virtual DateTime? After { get; set; }
public virtual string Channel { get; set; }
public virtual string Iterator { get; set; }
public virtual int? Limit { get; set; }
public virtual Ordering? Order { get; set; }
public virtual List<string> EventTypes { get; set; }
public virtual bool? WithContent { get; set; }
}
public partial class ListMessagesResponseDto
{
public ListMessagesResponseDto()
{
Data = new GetMessageResponseDto[]{};
}
public virtual GetMessageResponseDto[] Data { get; set; }
public virtual bool Done { get; set; }
public virtual string Iterator { get; set; }
}
public enum Ordering
{
[EnumMember(Value="ascending")]
Ascending = 1,
[EnumMember(Value="descending")]
Descending = 2,
}
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /webhook/messages HTTP/1.1 Host: api.bokamera.se Accept: text/jsv
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { Data: [ { Id: String, Channels: [ String ], EventType: String, Metadata: { String: String }, Payload: {}, EventId: String } ], Done: False, Iterator: String }