Interface WebHooksService
public interface WebHooksService
Webhooks service
Callback events are used to get notified about Numbers usage according to your configured callback URL
- Since:
- 1.2
-
Method Summary
Modifier and TypeMethodDescriptionparseEvent
(String jsonPayload) This function can be called to deserialize received payload onto callback.boolean
The Sinch Platform can initiate callback requests to a URL you define (Callback URL) on request and result events.
-
Method Details
-
validateAuthenticationHeader
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 requestBy 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 headersjsonPayload
- Received payload- Returns:
- Is authentication is validated (true) or not (false)
- Since:
- 1.2.1
-
parseEvent
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
-