WebhookClient
public class WebhookClient
An iOS client wrapper of the Cisco Webex Webhooks REST API .
Since
1.2.0-
Lists all webhooks of the authenticated user.
Since
1.2.0Declaration
Swift
public func list(max: Int? = nil, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<[Webhook]>) -> Void)Parameters
maxThe maximum number of webhooks in the response.
queueThe queue on which the completion handler is dispatched.
completionHandlerA closure to be executed once the request has finished.
Return Value
Void
-
Posts a webhook for the authenticated user.
Since
1.2.0Declaration
Swift
public func create(name: String, targetUrl: String, resource: String, event: String, filter: String? = nil, secret: String? = nil, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Webhook>) -> Void)Parameters
nameA user-friendly name for this webhook.
targetUrlThe URL that receives POST requests for each event.
resourceThe resource type for the webhook.
eventThe event type for the webhook.
filterThe filter that defines the webhook scope.
secetSecret use to generate payload signiture
queueThe queue on which the completion handler is dispatched.
secetSecret use to generate payload signiture
completionHandlerA closure to be executed once the request has finished.
Return Value
Void
-
Retrieves the details for a webhook by id.
Since
1.2.0Declaration
Swift
public func get(webhookId: String, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Webhook>) -> Void)Parameters
webhookIdThe identifier of the webhook.
queueThe queue on which the completion handler is dispatched.
completionHandlerA closure to be executed once the request has finished.
Return Value
Void
-
Updates a webhook by id.
Since
1.4.0Declaration
Swift
public func update(webhookId: String, name: String, targetUrl: String, secret: String? = nil, status: String? = nil, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Webhook>) -> Void)Parameters
webhookIdThe identifier of the webhook.
nameA user-friendly name for this webhook.
targetUrlThe URL that receives POST requests for each event.
statusThe status of the webhook. Use “active” to reactivate a disabled webhook.
secretThe secret used to generate payload signature.
queueThe queue on which the completion handler is dispatched.
completionHandlerA closure to be executed once the request has finished.
Return Value
Void
-
Deletes a webhook by id.
Since
1.2.0Declaration
Swift
public func delete(webhookId: String, queue: DispatchQueue? = nil, completionHandler: @escaping (ServiceResponse<Any>) -> Void)Parameters
webhookIdThe identifier of the webhook.
queueThe queue on which the completion handler is dispatched.
completionHandlerA closure to be executed once the request has finished.
webhookIdThe identifier of the webhook.
Return Value
Void
View on GitHub
WebhookClient Class Reference