Package com.sinch.sdk.domains.voice
Interface WebHooksService
public interface WebHooksService
Webhooks service
- Since:
- 1.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionserializeWebhooksResponse
(SVAMLControl response) This function can be called to serialize a Voice response to be sent as JSONunserializeWebhooksEvent
(String jsonPayload) This function can be called to deserialize received payload onto callback onto proper java Voice event classboolean
validateAuthenticatedRequest
(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
-
validateAuthenticatedRequest
boolean validateAuthenticatedRequest(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/voice/api-reference/authentication/callback-signed-request/
- Since:
- 1.0
-
unserializeWebhooksEvent
This function can be called to deserialize received payload onto callback onto proper java Voice event class- Parameters:
jsonPayload
- Received payload to be deserialized- Returns:
- The Voice event instance class
see https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/
- Throws:
ApiMappingException
- Since:
- 1.0
-
serializeWebhooksResponse
This function can be called to serialize a Voice response to be sent as JSON- Parameters:
response
- The response to be serialized- Returns:
- The JSON string to be sent
see https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/
- Throws:
ApiMappingException
- Since:
- 1.0
-