Interface WebHooksService
public interface WebHooksService
Webhooks service
Callback events are used to authorize and manage your verification requests and return verification results.
- Since:
- 1.1
-
Method Summary
Modifier and TypeMethodDescriptionparseEvent
(String jsonPayload) This function can be called to deserialize received payload onto callback onto proper java verification event classThis function can be called to serialize a verification response to be sent as JSONboolean
validateAuthenticationHeader
(String method, String path, 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 method, String path, 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 requestBy using following function, you can ensure authentication according to received payload from your backend
- Parameters:
method
- The HTTP method used ot handle the callbackpath
- The path to you backend endpoint used for callbackheaders
- Received headersjsonPayload
- Received payload- Returns:
- Is authentication is validated (true) or not (false)
see https://developers.sinch.com/docs/verification/api-reference/authentication/callback-signed-request
- Since:
- 1.1
-
parseEvent
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
- Throws:
ApiMappingException
- Since:
- 1.1
-
serializeResponse
This function can be called to serialize a verification response to be sent as JSON- Parameters:
response
- The response to be serialized- Returns:
- The JSON string to be sent
- Throws:
ApiMappingException
- Since:
- 1.1
-