Class WebhookDto
Representation of a webhook for an inbox. The URL specified will be using by MailSlurp whenever an email is received by the attached inbox. A webhook entity should have a URL that points to your server. Your server should accept HTTP/S POST requests and return a success 200. MailSlurp will retry your webhooks if they fail. See https://csharp.api.mailslurp.com/schemas/webhook-payload for the payload schema.
Inherited Members
Namespace: mailslurp.Model
Assembly: mailslurp.dll
Syntax
[DataContract(Name = "WebhookDto")]
public class WebhookDto : IEquatable<WebhookDto>, IValidatableObject
Constructors
View SourceWebhookDto()
Initializes a new instance of the WebhookDto class.
Declaration
[JsonConstructor]
protected WebhookDto()
WebhookDto(Guid, Guid, bool, string, Guid?, Guid?, string, string, MethodEnum, string, DateTime?, DateTime, EventNameEnum?, WebhookHeaders, bool?, bool?)
Initializes a new instance of the WebhookDto class.
Declaration
public WebhookDto(Guid id = default, Guid userId = default, bool basicAuth = false, string name = null, Guid? phoneId = null, Guid? inboxId = null, string requestBodyTemplate = null, string url = null, WebhookDto.MethodEnum method = (WebhookDto.MethodEnum)0, string payloadJsonSchema = null, DateTime? createdAt = null, DateTime updatedAt = default, WebhookDto.EventNameEnum? eventName = null, WebhookHeaders requestHeaders = null, bool? ignoreInsecureSslCertificates = null, bool? useStaticIpRange = null)
Parameters
Type | Name | Description |
---|---|---|
System.Guid | id | ID of the Webhook (required). |
System.Guid | userId | User ID of the Webhook (required). |
bool | basicAuth | Does webhook expect basic authentication? If true it means you created this webhook with a username and password. MailSlurp will use these in the URL to authenticate itself. (required). |
string | name | Name of the webhook. |
System.Guid? | phoneId | The phoneNumberId that the Webhook will be triggered by. If null then webhook triggered at account level or inbox level if inboxId set. |
System.Guid? | inboxId | The inbox that the Webhook will be triggered by. If null then webhook triggered at account level or phone level if phoneId set. |
string | requestBodyTemplate | Request body template for HTTP request that will be sent for the webhook. Use Moustache style template variables to insert values from the original event payload.. |
string | url | URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema. (required). |
WebhookDto.MethodEnum | method | HTTP method that your server endpoint must listen for (required). |
string | payloadJsonSchema | Deprecated. Fetch JSON Schema for webhook using the getJsonSchemaForWebhookPayload method (required). |
DateTime? | createdAt | When the webhook was created (required). |
DateTime | updatedAt | updatedAt (required). |
WebhookDto.EventNameEnum? | eventName | Webhook trigger event name. |
WebhookHeaders | requestHeaders | requestHeaders. |
bool? | ignoreInsecureSslCertificates | Should notifier ignore insecure SSL certificates. |
bool? | useStaticIpRange | Should notifier use static IP range when sending webhook payload. |
Properties
View SourceBasicAuth
Does webhook expect basic authentication? If true it means you created this webhook with a username and password. MailSlurp will use these in the URL to authenticate itself.
Declaration
[DataMember(Name = "basicAuth", IsRequired = true, EmitDefaultValue = true)]
public bool BasicAuth { get; set; }
Property Value
Type | Description |
---|---|
bool | Does webhook expect basic authentication? If true it means you created this webhook with a username and password. MailSlurp will use these in the URL to authenticate itself. |
CreatedAt
When the webhook was created
Declaration
[DataMember(Name = "createdAt", IsRequired = true, EmitDefaultValue = true)]
public DateTime? CreatedAt { get; set; }
Property Value
Type | Description |
---|---|
DateTime? | When the webhook was created |
EventName
Webhook trigger event name
Declaration
[DataMember(Name = "eventName", EmitDefaultValue = true)]
public WebhookDto.EventNameEnum? EventName { get; set; }
Property Value
Type | Description |
---|---|
WebhookDto.EventNameEnum? | Webhook trigger event name |
Id
ID of the Webhook
Declaration
[DataMember(Name = "id", IsRequired = true, EmitDefaultValue = true)]
public Guid Id { get; set; }
Property Value
Type | Description |
---|---|
System.Guid | ID of the Webhook |
IgnoreInsecureSslCertificates
Should notifier ignore insecure SSL certificates
Declaration
[DataMember(Name = "ignoreInsecureSslCertificates", EmitDefaultValue = true)]
public bool? IgnoreInsecureSslCertificates { get; set; }
Property Value
Type | Description |
---|---|
bool? | Should notifier ignore insecure SSL certificates |
InboxId
The inbox that the Webhook will be triggered by. If null then webhook triggered at account level or phone level if phoneId set
Declaration
[DataMember(Name = "inboxId", EmitDefaultValue = true)]
public Guid? InboxId { get; set; }
Property Value
Type | Description |
---|---|
System.Guid? | The inbox that the Webhook will be triggered by. If null then webhook triggered at account level or phone level if phoneId set |
Method
HTTP method that your server endpoint must listen for
Declaration
[DataMember(Name = "method", IsRequired = true, EmitDefaultValue = true)]
public WebhookDto.MethodEnum Method { get; set; }
Property Value
Type | Description |
---|---|
WebhookDto.MethodEnum | HTTP method that your server endpoint must listen for |
Name
Name of the webhook
Declaration
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; set; }
Property Value
Type | Description |
---|---|
string | Name of the webhook |
PayloadJsonSchema
Deprecated. Fetch JSON Schema for webhook using the getJsonSchemaForWebhookPayload method
Declaration
[DataMember(Name = "payloadJsonSchema", IsRequired = true, EmitDefaultValue = true)]
public string PayloadJsonSchema { get; set; }
Property Value
Type | Description |
---|---|
string | Deprecated. Fetch JSON Schema for webhook using the getJsonSchemaForWebhookPayload method |
PhoneId
The phoneNumberId that the Webhook will be triggered by. If null then webhook triggered at account level or inbox level if inboxId set
Declaration
[DataMember(Name = "phoneId", EmitDefaultValue = true)]
public Guid? PhoneId { get; set; }
Property Value
Type | Description |
---|---|
System.Guid? | The phoneNumberId that the Webhook will be triggered by. If null then webhook triggered at account level or inbox level if inboxId set |
RequestBodyTemplate
Request body template for HTTP request that will be sent for the webhook. Use Moustache style template variables to insert values from the original event payload.
Declaration
[DataMember(Name = "requestBodyTemplate", EmitDefaultValue = true)]
public string RequestBodyTemplate { get; set; }
Property Value
Type | Description |
---|---|
string | Request body template for HTTP request that will be sent for the webhook. Use Moustache style template variables to insert values from the original event payload. |
RequestHeaders
Gets or Sets RequestHeaders
Declaration
[DataMember(Name = "requestHeaders", EmitDefaultValue = false)]
public WebhookHeaders RequestHeaders { get; set; }
Property Value
Type | Description |
---|---|
WebhookHeaders |
UpdatedAt
Gets or Sets UpdatedAt
Declaration
[DataMember(Name = "updatedAt", IsRequired = true, EmitDefaultValue = true)]
public DateTime UpdatedAt { get; set; }
Property Value
Type | Description |
---|---|
DateTime |
Url
URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema.
Declaration
[DataMember(Name = "url", IsRequired = true, EmitDefaultValue = true)]
public string Url { get; set; }
Property Value
Type | Description |
---|---|
string | URL of your server that the webhook will be sent to. The schema of the JSON that is sent is described by the payloadJsonSchema. |
UserId
User ID of the Webhook
Declaration
[DataMember(Name = "userId", IsRequired = true, EmitDefaultValue = true)]
public Guid UserId { get; set; }
Property Value
Type | Description |
---|---|
System.Guid | User ID of the Webhook |
UseStaticIpRange
Should notifier use static IP range when sending webhook payload
Declaration
[DataMember(Name = "useStaticIpRange", EmitDefaultValue = true)]
public bool? UseStaticIpRange { get; set; }
Property Value
Type | Description |
---|---|
bool? | Should notifier use static IP range when sending webhook payload |
Methods
View SourceEquals(WebhookDto)
Returns true if WebhookDto instances are equal
Declaration
public bool Equals(WebhookDto input)
Parameters
Type | Name | Description |
---|---|---|
WebhookDto | input | Instance of WebhookDto to be compared |
Returns
Type | Description |
---|---|
bool | Boolean |
Equals(object)
Returns true if objects are equal
Declaration
public override bool Equals(object input)
Parameters
Type | Name | Description |
---|---|---|
object | input | Object to be compared |
Returns
Type | Description |
---|---|
bool | Boolean |
Overrides
View SourceGetHashCode()
Gets the hash code
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | Hash code |
Overrides
View SourceToJson()
Returns the JSON string presentation of the object
Declaration
public virtual string ToJson()
Returns
Type | Description |
---|---|
string | JSON string presentation of the object |
ToString()
Returns the string presentation of the object
Declaration
public override string ToString()
Returns
Type | Description |
---|---|
string | String presentation of the object |
Overrides
Validate(ValidationContext)
To validate all properties of the instance
Declaration
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
Parameters
Type | Name | Description |
---|---|---|
ValidationContext | validationContext | Validation context |
Returns
Type | Description |
---|---|
IEnumerable<ValidationResult> | Validation Result |