-
Notifications
You must be signed in to change notification settings - Fork 0
feat (samples/webhooks): Report 'webhooks' server template from quickstart repository #302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat/V2.0-next
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,4 @@ | ||
| name: Snippets Compilation | ||
| name: Examples Compilation | ||
|
|
||
| on: [push] | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| #!/bin/sh | ||
|
|
||
| (cd snippets && ./compile.sh) || exit 1 | ||
| (cd webhooks && ./compile.sh) || exit 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| wrapperVersion=3.3.2 | ||
| distributionType=only-script | ||
| distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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) | ||
|
|
||
| ## Requirements | ||
|
|
||
| - JDK 21 or later (Sinch SDK Java is requiring java 8 only but client application can use latest available version) | ||
| - [Maven](https://maven.apache.org/) | ||
| - [SpringBoot](https://spring.io/projects/spring-boot) | ||
| - [Sinch account](https://dashboard.sinch.com) | ||
| - [ngrok](https://ngrok.com/docs) | ||
|
|
||
| ## Configuration | ||
|
|
||
| ### Configure application settings | ||
|
|
||
| com.mycompany.app.Application settings are using the `SpringBoot` configuration file: [`application.yaml`](src/main/resources/application.yaml) file and enable to configure: | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand this section. Is it an application package? |
||
|
|
||
| #### Sinch credentials | ||
| Located in `credentials` section (*you can find all of the credentials you need on your [Sinch dashboard](https://dashboard.sinch.com)*): | ||
| - `project-id`: YOUR_project_id | ||
| - `key-id`: YOUR_access_key_id | ||
| - `key-secret`: YOUR_access_key_secret | ||
|
Comment on lines
+21
to
+23
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For most of the use cases, they are not needed |
||
|
|
||
| #### Server port | ||
| <em>Default: 8090</em> | ||
|
|
||
| Located in `server` section: | ||
| - port: The port to be used to listen to incoming requests. <em>Default: 8090</em> | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Start server | ||
| 1. Edit configuration file | ||
|
|
||
| See above for Configuration paragraph | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add reference link “See Configuration” |
||
|
|
||
| 2. Start server locally. | ||
|
|
||
| Compile and run the application as server locally. | ||
| ```bash | ||
| ./mvnw clean spring-boot:run | ||
| ``` | ||
| ### EndPoints | ||
| When server is online, declared controllers will respond to following endpoints | ||
|
|
||
| | Service | Endpoint | | ||
| |------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------| | ||
| | [Conversation](https://developers.sinch.com/docs/conversation/callbacks) | /ConversationEvent | | ||
| | [Numbers](https://developers.sinch.com/docs/numbers/api-reference/numbers/tag/Numbers-Callbacks/#tag/Numbers-Callbacks/operation/ImportedNumberService_EventsCallback) | /NumbersEvent | | ||
| | [SMS](https://developers.sinch.com/docs/sms/api-reference/sms/tag/Webhooks/#tag/Webhooks/section/Callbacks) | /SmsEvent | | ||
| | [Verification](https://developers.sinch.com/docs/verification/api-reference/verification/tag/Verification-callbacks/) | /VerificationEvent | | ||
| | [Voice](https://developers.sinch.com/docs/voice/api-reference/voice/tag/Callbacks/) | /VoiceEvent | | ||
|
|
||
| ## Use ngrok to forward request to local server | ||
|
|
||
| Forwarding request to same `8090` port used above: | ||
|
|
||
| *Note: The `8090` value is coming from default config and can be changed (see [Server port](#Server port) configuration section)* | ||
|
|
||
| ```bash | ||
| ngrok http 8090 | ||
| ``` | ||
|
|
||
| ngrok output will contains output like: | ||
| ``` | ||
| ngrok (Ctrl+C to quit) | ||
|
|
||
| ... | ||
| Forwarding https://0e64-78-117-86-140.ngrok-free.app -> http://localhost:8090 | ||
|
|
||
| ``` | ||
| The line | ||
| ``` | ||
| Forwarding https://0e64-78-117-86-140.ngrok-free.app -> http://localhost:8090 | ||
| ``` | ||
| Contains `https://0e64-78-117-86-140.ngrok-free.app` value. | ||
|
|
||
| This value must be used to configure callback's URL from your [Sinch dashboard](https://dashboard.sinch.com/sms/api/services) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| #!/bin/sh | ||
|
|
||
| mvn clean spotless:apply || exit 1 | ||
|
|
||
| ./mvnw clean compile || exit 1 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
English: don't use
ontobuton:Onto implies movement toward a surface or position, this is not the case here