Interface WebHooksService


public interface WebHooksService
Webhooks service

Callback events are used to get notified about Numbers usage according to your configured callback URL

see online documentation

Since:
1.2
  • Method Summary

    Modifier and Type
    Method
    Description
    parseEvent(String jsonPayload)
    This function can be called to deserialize received payload onto callback.
    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.
  • 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 using your Application key and secret pair found on your dashboard. 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 - The HMAC secret used for hashing the callback body using the HMAC-SHA1 algorithm and for creating the X-Sinch-Signature header.
      headers - Received headers
      jsonPayload - Received payload
      Returns:
      Is authentication is validated (true) or not (false)

      see online documentation

      Since:
      1.2.1
    • parseEvent

      NumberEvent parseEvent(String jsonPayload) throws ApiMappingException
      This function can be called to deserialize received payload onto callback. Function return Java class instance from un-serialized payload
      Parameters:
      jsonPayload - Received payload to be un-serialized
      Returns:
      The decoded event notification instance class
      Throws:
      ApiMappingException
      Since:
      1.2