Package com.sinch.sdk.domains.voice
Interface WebHooksService
-
public interface WebHooksServiceWebhooks service- Since:
- 1.0
- See Also:
- https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringserializeWebhooksResponse(SVAMLControl response)This function can be called to serialize a Voice response to be sent as JSONWebhooksEventunserializeWebhooksEvent(String jsonPayload)This function can be called to deserialize received payload onto callback onto proper java Voice event classbooleanvalidateAuthenticatedRequest(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
-
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
WebhooksEvent unserializeWebhooksEvent(String jsonPayload) throws ApiMappingException
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
String serializeWebhooksResponse(SVAMLControl response) throws ApiMappingException
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
-
-