Report Filing Service

<back to all web services

DeleteWebhookSubscription

DeleteSubscriptionsWebhooksSync

Represents a request to delete a webhook subscription.

Requires Authentication
The following routes are available for this service:
POST/sync/webhooks/subscriptions/{Id}/delete
import Foundation
import ServiceStack

/**
* Represents a request to delete a webhook subscription.
*/
// @Api(Description="Represents a request to delete a webhook subscription.")
public class DeleteWebhookSubscription : DeleteWebhookSubscriptionBase
{
    required public init(){ super.init() }

    required public init(from decoder: Decoder) throws {
        try super.init(from: decoder)
    }

    public override func encode(to encoder: Encoder) throws {
        try super.encode(to: encoder)
    }
}

/**
* Specifies a request to delete a webhook subscription.
*/
// @Api(Description="Specifies a request to delete a webhook subscription.")
public class DeleteWebhookSubscriptionBase : IPost, Codable
{
    /**
    * The unique identifier of the subscriber.
    */
    // @ApiMember(Description="The unique identifier of the subscriber.", IsRequired=true, Name="Id")
    public var id:String

    /**
    * The secret of the to-be-deleted webhook subscription. This secret is used to authenticate the owner of the webhook subscription.
    */
    // @ApiMember(Description="The secret of the to-be-deleted webhook subscription. This secret is used to authenticate the owner of the webhook subscription.", IsRequired=true, Name="Secret")
    public var secret:String

    required public init(){}
}

/**
* Represents a service response that encapsulates a webhook subscription.
*/
// @Api(Description="Represents a service response that encapsulates a webhook subscription.")
public class SubscriptionResponse : Codable
{
    /**
    * The encapsulated webhook subscription of the response. The secret of the webhook subscription is encrypted and can only be decrypted by the owner of the private key.
    */
    // @ApiMember(Description="The encapsulated webhook subscription of the response. The secret of the webhook subscription is encrypted and can only be decrypted by the owner of the private key.", Name="Subscription")
    public var subscription:WebhookSubscription

    /**
    * The history of the subscription event.
    */
    // @ApiMember(Description="The history of the subscription event.", Name="History")
    public var history:[SubscriptionDeliveryResult] = []

    /**
    * The status of the response.
    */
    // @ApiMember(Description="The status of the response.", Name="ResponseStatus")
    public var responseStatus:ResponseStatus

    required public init(){}
}

public class WebhookSubscription : Codable
{
    public var id:String
    public var name:String
    public var event:String
    public var isActive:Bool
    public var createdDateUtc:Date
    public var createdById:String
    public var lastModifiedDateUtc:Date
    public var config:SubscriptionConfig

    required public init(){}
}

public class SubscriptionConfig : Codable
{
    public var url:String
    public var contentType:String
    public var secret:String

    required public init(){}
}

public class SubscriptionDeliveryResult : Codable
{
    public var attemptedDateUtc:Date
    public var statusDescription:String
    public var statusCode:HttpStatusCode
    public var subscriptionId:String
    public var id:String
    public var eventId:String

    required public init(){}
}


Swift DeleteWebhookSubscription 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 /sync/webhooks/subscriptions/{Id}/delete HTTP/1.1 
Host: reportfiling.staging.pwc.de 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	id: String,
	secret: String
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	subscription: 
	{
		id: String,
		name: String,
		event: String,
		isActive: False,
		createdDateUtc: 0001-01-01,
		createdById: String,
		lastModifiedDateUtc: 0001-01-01,
		config: 
		{
			url: String,
			contentType: String,
			secret: String
		}
	},
	history: 
	[
		{
			attemptedDateUtc: 0001-01-01,
			statusDescription: String,
			statusCode: Continue,
			subscriptionId: String,
			id: String,
			eventId: String
		}
	],
	responseStatus: 
	{
		errorCode: String,
		message: String,
		stackTrace: String,
		errors: 
		[
			{
				errorCode: String,
				fieldName: String,
				message: String,
				meta: 
				{
					String: String
				}
			}
		],
		meta: 
		{
			String: String
		}
	}
}