Skip to content

Commit bf0174d

Browse files
authored
Added kotlin Get notifications, Get notification statistics, Get notification example (#268) (#269)
1 parent e36ac49 commit bf0174d

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

api-reference/notification/get-notification-statistics.mdx

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ openapi: get /v1/notifications/stats
66

77
<RequestExample>
88

9+
```kotlin Kotlin
10+
import co.novu.Novu
11+
import co.novu.extensions.notificationsStats
12+
13+
fun main() {
14+
val novu = Novu(apiKey = "<NOVU_API_KEY>")
15+
val notificationsStats = novu.notificationsStats()
16+
println(notificationsStats)
17+
}
18+
```
19+
920
```bash cURL
1021
curl --request GET \
1122
--url https://api.novu.co/v1/notifications/stats \
@@ -22,4 +33,5 @@ notificationApi = NotificationApi(url, api_key)
2233

2334
notification_stats = notificationApi.stats()
2435
```
36+
2537
</RequestExample>

api-reference/notification/get-notification.mdx

+12
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,17 @@ openapi: get /v1/notifications/{notificationId}
66

77
<RequestExample>
88

9+
```kotlin Kotlin
10+
import co.novu.Novu
11+
import co.novu.extensions.notification
12+
13+
fun main() {
14+
val novu = Novu(apiKey = "<NOVU_API_KEY>")
15+
val notification = novu.notification("<NOTIFICATION_ID>")
16+
println(notification)
17+
}
18+
```
19+
920
```bash cURL
1021
curl --request GET \
1122
--url https://api.novu.co/v1/notifications/{notificationId} \
@@ -23,4 +34,5 @@ notificationApi = NotificationApi(url, api_key)
2334
notification = notificationApi.get("<notificationId>")
2435
print(notification)
2536
```
37+
2638
</RequestExample>

api-reference/notification/get-notifications.mdx

+14
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,19 @@ openapi: get /v1/notifications
66

77
<RequestExample>
88

9+
```kotlin Kotlin
10+
import co.novu.Novu
11+
import co.novu.dto.request.NotificationRequest
12+
import co.novu.extensions.notifications
13+
14+
fun main() {
15+
val novu = Novu(apiKey = "<NOVU_API_KEY>")
16+
val notificationRequest = NotificationRequest("<CHANNELS>", "<TEMPLATES>", "<EMAILS>", "<SEARCH>");
17+
val notifications = novu.notifications(notificationRequest)
18+
println(notifications)
19+
}
20+
```
21+
922
```bash cURL
1023
curl --request GET \
1124
--url https://api.novu.co/v1/notifications \
@@ -22,4 +35,5 @@ notificationApi = NotificationApi(url, api_key)
2235

2336
notifications = notificationApi.list()
2437
```
38+
2539
</RequestExample>

0 commit comments

Comments
 (0)