{"id":19123308,"url":"https://github.com/vonage/vonage-java-code-snippets","last_synced_at":"2026-04-01T20:43:22.830Z","repository":{"id":42128146,"uuid":"82467258","full_name":"Vonage/vonage-java-code-snippets","owner":"Vonage","description":"Java code examples for using Vonage","archived":false,"fork":false,"pushed_at":"2026-02-20T19:41:57.000Z","size":633,"stargazers_count":10,"open_issues_count":4,"forks_count":32,"subscribers_count":14,"default_branch":"main","last_synced_at":"2026-02-21T00:54:18.293Z","etag":null,"topics":["java","java-quickstarts","messaging","nexmo","nexmo-quickstart","phone-call","sms","vonage"],"latest_commit_sha":null,"homepage":"https://developer.vonage.com","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Vonage.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2017-02-19T15:05:27.000Z","updated_at":"2026-02-20T19:31:34.000Z","dependencies_parsed_at":"2025-02-15T17:26:34.426Z","dependency_job_id":"adf5974b-fd82-4d46-83f7-a4959345ae30","html_url":"https://github.com/Vonage/vonage-java-code-snippets","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Vonage/vonage-java-code-snippets","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-java-code-snippets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-java-code-snippets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-java-code-snippets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-java-code-snippets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Vonage","download_url":"https://codeload.github.com/Vonage/vonage-java-code-snippets/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Vonage%2Fvonage-java-code-snippets/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31291778,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T13:12:26.723Z","status":"ssl_error","status_checked_at":"2026-04-01T13:12:25.102Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","java-quickstarts","messaging","nexmo","nexmo-quickstart","phone-call","sms","vonage"],"created_at":"2024-11-09T05:25:05.169Z","updated_at":"2026-04-01T20:43:22.810Z","avatar_url":"https://github.com/Vonage.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vonage Quickstart Examples for Java\n\n[![Build Status](https://github.com/Vonage/vonage-java-code-snippets/actions/workflows/build.yml/badge.svg)](https://github.com/Vonage/vonage-kotlin-sdk/actions/workflows/build.yml)\n![CodeQL](https://github.com/Vonage/vonage-java-code-snippets/actions/workflows/codeql.yml/badge.svg)\n![SLOC](https://sloc.xyz/github/Vonage/vonage-java-code-snippets)\n[![Contributor Covenant](https://img.shields.io/badge/Contributor%20Covenant-2.1-4baaaa.svg)](CODE_OF_CONDUCT.md)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Community Slack](https://img.shields.io/badge/Slack-4A154B?style=flat\u0026logo=slack\u0026logoColor=white)](https://developer.vonage.com/community/slack)\n\n\u003cimg src=\"https://developer.nexmo.com/assets/images/Vonage_Nexmo.svg\" height=\"48px\" alt=\"Nexmo is now known as Vonage\" /\u003e\n\nQuickstarts also available for:\n- [Kotlin](https://github.com/Vonage/vonage-kotlin-code-snippets)\n- [Python](https://github.com/Vonage/vonage-python-code-snippets)\n- [.NET](https://github.com/Vonage/vonage-dotnet-code-snippets)\n- [Node.js](https://github.com/Vonage/vonage-node-code-snippets)\n- [PHP](https://github.com/Vonage/vonage-php-code-snippets)\n- [Ruby](https://github.com/Vonage/vonage-ruby-code-snippets)\n- [cURL](https://github.com/Vonage/vonage-curl-code-snippets)\n\nThe purpose of the quickstart guide is to provide simple examples focused on one goal. For example, sending an SMS, handling an incoming SMS webhook, making a Text to Speech call. These code samples are meant to be used for https://developer.vonage.com/, and are structured in such a way as to be used for internal testing. Developers are free to use these code snippets as a reference, but these may require changes to be worked into your specific application. We recommend checking out the Vonage Developer Website, which displays these code snippets in a more copy/paste fashion.\n\n## Setup\n\nTo use this sample you will first need a [Vonage account][sign-up].\n\nFor some of the examples you will need to [buy a number][buy-number].\n\n## Building The Library\n\nYou will need to have [Gradle](https://gradle.org/) installed to build the code. Once you have Gradle installed,\nrun the following to build a jar that contains the quickstart code along with all\nthe [Vonage Java Server SDK](https://github.com/Vonage/vonage-java-sdk) dependencies:\n\n```sh\ngradle assemble\n```\n\nThis will build the following file: `build/libs/vonage-java-code-snippets-with-dependencies.jar`\n\n## Running The Examples\n\nCopy `.env-example` to `.env` and edit the values. You'll need to load those\nvalues into environment variables, so you'll probably want to use a tool like\n[Foreman](https://github.com/ddollar/foreman) to run your code like this:\n\n```sh\nforeman run java -cp build/libs/vonage-java-code-snippets-with-dependencies.jar PACKAGE.CLASS\n```\n\nSo to run the OutboundTextToSpeechExample class, you would run the following:\n\n```sh\nforeman run java -cp build/libs/vonage-java-code-snippets-with-dependencies.jar com.vonage.quickstart.voice.OutboundTextToSpeech\n```\n\nIf you set the environment variable `QUICKSTART_DEBUG` to any value, extra information\nwill be output to the console from the Vonage Server SDK.\n\n## Running NCCO Webhook Examples\n\nSign up for a free [ngrok](https://ngrok.com/) account\n\nDownload and install from the ngrok site or use Homebrew (mac0S)\n\n```sh\nbrew install cask ngrok\n```\n\n### Connect the installed ngrok to your ngrok account\n1. Go to your ngrok dashboard.\n2. Go to Setup \u0026 Installation\n3. Copy the token from the **Connect your account** step without the `./` prefix. What you copy should look like this:\n```shell script\nngrok authentication 112skjl4jlwlkjdl4lkj66565lkjmn56n==e4w4l\n```\n4. Start a HTTP tunnel forwarding to your local port. Check your snippet to locate the port ngrok should forward to.\nFor the Voice NCCO snippets we use port 3000, so our command would be:\n```shell script\nngrok http 3000\n```\n\nYou may then enter `http://localhost:4040/inspect/http` in your web browser to see a more detailed view of your requests, or use the \nconsole to http status and message of your requests. \n\n### Setup a Vonage Application \n\nAfter setting up `ngrok` you will need to setup a Vonage application that will be used for monitoring your webhooks. Add a vonage feature\nthat you would like your webhook to monitor for. In this example, we will setup a Vonage application and add voice capabilities. \n\nSetup a Vonage Application with voice capabilities using the [Vonage Developer Portal](https://dashboard.nexmo.com/)\n1. On the developer portal, go to Applications.\n2. Click on the **Create new application** button.\n3. Give your applications a name.\n4. Under *Capabilities*, toggle the *Voice* capability.\nGo back to the terminal that has ngrok fired up and grab the forwarding url. Add that domain as the prefix to the path for the \nwebhook. Resulting url should look similar to the following:\n```sh\n http://17e80b46d273.ngrok.io/webhook/answer\n```\nGo back to the *Voice* capabilities section and add the urls for the webhooks. Ex:\n\n**Answer URL:** http://17e80b46d273.ngrok.io/webhook/answer\n\n**Event URL:** http://17e80b46d273.ngrok.io/webhook/event\n\n**Answer Fallback URL:** http://17e80b46d273.ngrok.io/webhook/fallback (if no path is specified in the snippet use a random domain)\n\n5. Click the **generate public and private key** button. A private key file called private.key should be downloaded to your computer.\n6. Move the private key to the nexmo-java-code-snippets project root.\n7. Go the developer portal and click **Generate application**\n8. In your `.env` file, add the environment variables for your application that is needed to run the snippet to. For the voice dtmf webhook snippet,\nwe would need the *application id*, and *private key file location* \n9. (Optional) Link the number associated with your nexmo account to your app. In the developer portal, click the Link button\non the application details screen to link that number to your application. This will allow you to test webhooks that require you to \ncall or text a number to test the NCCOs for that snippet.\n\n\n\n## Request an Example\n\nPlease [raise an issue](https://github.com/nexmo-community/nexmo-java-quickstart/issues) to request an example that isn't present within the quickstart. Pull requests will be gratefully received.\n\n## License\n\nThis code is licensed under the [MIT](LICENSE.txt) license.\n\n[gradle]: https://gradle.org/\n[foreman]: https://github.com/ddollar/foreman\n[sign-up]: https://dashboard.nexmo.com/sign-up\n[buy-number]: https://dashboard.nexmo.com/buy-numbers\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvonage%2Fvonage-java-code-snippets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvonage%2Fvonage-java-code-snippets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvonage%2Fvonage-java-code-snippets/lists"}