Java Quickstart
This quickstart demonstrates how to send messages from a Java application.
Java Quickstart
- Make sure you have the latest version of Java installed.
- Sign up for Courier to get access to your API key.
- Add the channel(s) you wish to send your message to.
- Copy the following Courier Java SDK dependency snippet and add to Maven pom.xml file
- Ask Maven to download the dependencies by running:
- Add the following code to import dependencies:
- Add the following code to send the message:
-
Replace the variables to match the type and content of notification you want to send. There are 4 main properties within this example notification:
to
: provide information used by Courier to identify the recipient of the notification. Here you can include details such as the recipient’s email address for email, phone number for SMS.content
: add your notification’s title and body.data
: include any data you want to pass to a message template. The data will populate the corresponding template variables.routing
: customize which channel(s) Courier will potentially deliver the message. If no routing key is specified, Courier will use the default routing configured in the Courier Studio UI.
Explore how to customize your notification with more properties >
-
Run your code. Upon running this API call, only a requestId will be returned.
- Monitor the status of your notification (once sent) in the logs: https://app.courier.com/logs
FAQs
Questions?
Join our developer community on Discord and ask questions in the #ask-support channel.