feat (samples/webhooks): Report 'webhooks' server template from quickstart repository#302
Conversation
Dependency Review✅ No vulnerabilities or license issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned Manifest Filesexamples/webhooks/pom.xml
|
examples/webhooks/src/main/java/com/mycompany/app/mailgun/Controller.java
Outdated
Show resolved
Hide resolved
examples/webhooks/src/main/java/com/mycompany/app/mailgun/Controller.java
Outdated
Show resolved
Hide resolved
examples/webhooks/src/main/java/com/mycompany/app/mailgun/ServerBusinessLogic.java
Outdated
Show resolved
Hide resolved
| value = "/SmsEvent", | ||
| consumes = MediaType.APPLICATION_JSON_VALUE, | ||
| produces = MediaType.APPLICATION_JSON_VALUE) | ||
| public ResponseEntity<Void> smsDeliveryEvent( |
There was a problem hiding this comment.
Nit: events are not about delivery reports only.
| public void processInboundEvent(InboundMessage event) { | ||
| trace(event); | ||
| } |
There was a problem hiding this comment.
As you are splitting the inbounds and the delivery reports, do you think it makes sense to also showcase the different kinds of inbounds and delivery reports?
There was a problem hiding this comment.
Not sure, I could have think to reduce snippet to simple "SmsEvent"
The current trace will display the type of event (because of part of the toString from classes)
|
|
||
| LOGGER.finest("JSON response: " + serializedResponse); | ||
|
|
||
| return ResponseEntity.ok().body(serializedResponse); |
There was a problem hiding this comment.
Same question for DICE, PIE and notification events: does it make sense to return "null" in the 200 OK JSON response body?
There was a problem hiding this comment.
Right.
Replaced with empty bodies too.
|
|
||
| LOGGER.info("Handle event :" + event); | ||
|
|
||
| return SvamlControl.builder().build(); |
There was a problem hiding this comment.
Is there a place where you showcase the construction of a SVAML response (action + multiple instructions)?
There was a problem hiding this comment.
No, not within this skeleton (this is not the purpose of this skeleton)
But when getting-started and tutorials will be migrated here: yes:
- https://github.com/sinch/sinch-sdk-java-quickstart/blob/main/getting-started/voice/respond-to-incoming-call/server/src/main/java/com/mycompany/app/voice/ServerBusinessLogic.java
- https://github.com/sinch/sinch-sdk-java-quickstart/blob/main/tutorials/voice/capture-leads-app/src/main/java/com/mycompany/app/voice/ServerBusinessLogic.java
| application-api-key: | ||
| application-api-secret: |
There was a problem hiding this comment.
Nit: referred as application key and application secret in the documentation
There was a problem hiding this comment.
Snippets are also based onto "xxx-api-xxx"; if going to this direction will be part of dedicated ticket
examples/webhooks/README.md
Outdated
| @@ -0,0 +1,79 @@ | |||
| # Backend application built using Sinch Java SDK to handle incoming webhooks | |||
|
|
|||
| This directory contains a server application based onto [Sinch SDK java](https://github.com/sinch/sinch-sdk-java) | |||
There was a problem hiding this comment.
English: don't use onto but on:
| This directory contains a server application based onto [Sinch SDK java](https://github.com/sinch/sinch-sdk-java) | |
| This directory contains a server application based on the [Sinch SDK java](https://github.com/sinch/sinch-sdk-java) |
Onto implies movement toward a surface or position, this is not the case here
| - `project-id`: YOUR_project_id | ||
| - `key-id`: YOUR_access_key_id | ||
| - `key-secret`: YOUR_access_key_secret |
There was a problem hiding this comment.
For most of the use cases, they are not needed
There was a problem hiding this comment.
Yes but here we are delivering a general purpose skeleton
Added a dedicated comment for this section to help users/AIs to consume it properly
No description provided.