Skip to content
This repository was archived by the owner on Aug 14, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Intercom('show');
<SupportedEnvironment logo="devicon-php-plain" name="PHP" path="./reference/server" />
<SupportedEnvironment logo="devicon-go-original-wordmark" name="Go" path="./reference/server" />
<SupportedEnvironment logo="devicon-csharp-plain" name="C#" path="./reference/server" />
<SupportedEnvironment logo="devicon-java-plain" name="Java" path="./reference/server" />
<SupportedEnvironment logo="devicon-ruby-plain" name="Ruby" path="./reference/server" />
</div>

Expand Down
64 changes: 64 additions & 0 deletions docs/quick-start/send-a-notification.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ values={[
{ label: 'PHP', value: 'php' },
{ label: 'Go', value: 'go' },
{ label: 'C#', value: 'csharp' },
{ label: 'Java', value: 'java' },
{ label: 'Ruby', value: 'ruby' }
]}>
<TabItem value="js">
Expand Down Expand Up @@ -79,6 +80,34 @@ Install the package:
dotnet add package NotificationAPI --version 0.5.0
```

</TabItem>
<TabItem value="java">

Add the following dependency to your Maven project:

```xml
<dependency>
<groupId>com.notificationapi</groupId>
<artifactId>notificationapi-java-server-sdk</artifactId>
<version>0.2.0</version>
</dependency>
```

For optimal functionality, you'll also need the following dependencies:

```xml
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
</dependency>
```

</TabItem>
<TabItem value="ruby">

Expand Down Expand Up @@ -194,6 +223,7 @@ values={[
{ label: 'PHP', value: 'php' },
{ label: 'Go', value: 'go' },
{ label: 'C#', value: 'csharp' },
{ label: 'Java', value: 'java' },
{ label: 'Ruby', value: 'ruby' }
]
}>
Expand Down Expand Up @@ -369,6 +399,40 @@ await notificationApi.Send(new SendNotificationData("order_tracking", user)
});
```

</TabItem>
<TabItem value="java">

```java
// import
import com.notificationapi.NotificationApi;
import com.notificationapi.model.NotificationRequest;
import com.notificationapi.model.User;
import java.util.HashMap;
import java.util.Map;

// Initialize NotificationAPI (default US region)
// If in the CA region, use the third parameter: "https://api.ca.notificationapi.com"
// If in the EU region, use the third parameter: "https://api.eu.notificationapi.com"
NotificationApi api = new NotificationApi("CLIENT_ID", "CLIENT_SECRET", "https://api.notificationapi.com");

// Create user
User user = new User("spongebob.squarepants")
.setEmail("spongebob@squarepants.com") // required for email notifications
.setNumber("+15005550006"); // optional phone number required to send SMS notifications

// Create merge tags
Map<String, Object> mergeTags = new HashMap<>();
mergeTags.put("item", "Krabby Patty Burger");
mergeTags.put("address", "124 Conch Street");
mergeTags.put("orderId", "1234567890");

// Create and send notification request
NotificationRequest request = new NotificationRequest("order_tracking", user)
.setMergeTags(mergeTags);

String response = api.send(request);
```

</TabItem>
<TabItem value="ruby">

Expand Down
Loading