Interface WebHooksService


public interface WebHooksService
Webhooks service

The Conversation API delivers contact messages, delivery receipts for app messages and various notifications through callbacks.

see online documentation

Since:
1.3
  • Method Details

    • validateAuthenticationHeader

      boolean validateAuthenticationHeader(String secret, Map<String,String> headers, String jsonPayload)
      The Sinch Platform can initiate callback requests to a URL you define (Callback URL) on request and result events. All callback requests are signed and the signature is included in the Authorization header of the request

      By using following function, you can ensure authentication according to received payload from your backend

      Parameters:
      secret - Secret token to be used to validate received request. See App's webhook configuration onto dashboard
      headers - Received headers
      jsonPayload - Received payload
      Returns:
      Is authentication is validated (true) or not (false)

      see online documentation

      Since:
      1.3
    • parseEvent

      ConversationWebhookEvent parseEvent(String jsonPayload) throws ApiMappingException
      This function can be called to deserialize received payload onto callback onto proper java verification event class
      Parameters:
      jsonPayload - Received payload to be deserialized
      Returns:
      The verification event instance class

      see triggered events

      Throws:
      ApiMappingException
      Since:
      1.3
    • list

      Collection<Webhook> list(String appId)
      List all webhooks for a given app as specified by the App ID.
      Parameters:
      appId - The unique ID of the app
      Returns:
      List of defined webhooks
      Since:
      1.3
    • get

      Webhook get(String webhookId)
      Get a webhook as specified by the webhook ID.
      Parameters:
      webhookId - The unique ID of the webhook.
      Returns:
      Webhook definition
      Since:
      1.3
    • create

      Webhook create(Webhook webhook)
      Creates a webhook for receiving callbacks on specific triggers
      Parameters:
      webhook - Webhook parameter for creation
      Returns:
      Created webhook
      Since:
      1.3
    • update

      Webhook update(String webhookId, Webhook webhook)
      Updates an existing webhook as specified by the webhook ID.
      Parameters:
      webhookId - The unique ID of the webhook.
      webhook - Webhook parameter for creation
      Returns:
      Created webhook
      Since:
      1.3
    • delete

      void delete(String webhookId)
      Deletes a webhook as specified by the webhook ID
      Parameters:
      webhookId - The unique ID of the webhook.
      Since:
      1.3