Interface WebHooksService
-
public interface WebHooksServiceWebhooks serviceCallback events are used to authorize and manage your verification requests and return verification results.
- Since:
- 1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description VerificationEventparseEvent(String jsonPayload)This function can be called to deserialize received payload onto callback onto proper java verification event classStringserializeResponse(VerificationResponse response)This function can be called to serialize a verification response to be sent as JSONbooleanvalidateAuthenticationHeader(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 Detail
-
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.0
-
parseEvent
VerificationEvent 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
- Throws:
ApiMappingException- Since:
- 1.0
-
serializeResponse
String serializeResponse(VerificationResponse response) throws ApiMappingException
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.0
-
-