Skip to content

Commit

Permalink
Added kotlin Get notifications, Get notification statistics, Get noti…
Browse files Browse the repository at this point in the history
…fication example (#268) (#269)
  • Loading branch information
biplobsd authored Nov 19, 2023
1 parent e36ac49 commit bf0174d
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api-reference/notification/get-notification-statistics.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ openapi: get /v1/notifications/stats

<RequestExample>

```kotlin Kotlin
import co.novu.Novu
import co.novu.extensions.notificationsStats

fun main() {
val novu = Novu(apiKey = "<NOVU_API_KEY>")
val notificationsStats = novu.notificationsStats()
println(notificationsStats)
}
```

```bash cURL
curl --request GET \
--url https://api.novu.co/v1/notifications/stats \
Expand All @@ -22,4 +33,5 @@ notificationApi = NotificationApi(url, api_key)

notification_stats = notificationApi.stats()
```

</RequestExample>
12 changes: 12 additions & 0 deletions api-reference/notification/get-notification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,17 @@ openapi: get /v1/notifications/{notificationId}

<RequestExample>

```kotlin Kotlin
import co.novu.Novu
import co.novu.extensions.notification

fun main() {
val novu = Novu(apiKey = "<NOVU_API_KEY>")
val notification = novu.notification("<NOTIFICATION_ID>")
println(notification)
}
```

```bash cURL
curl --request GET \
--url https://api.novu.co/v1/notifications/{notificationId} \
Expand All @@ -23,4 +34,5 @@ notificationApi = NotificationApi(url, api_key)
notification = notificationApi.get("<notificationId>")
print(notification)
```

</RequestExample>
14 changes: 14 additions & 0 deletions api-reference/notification/get-notifications.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,19 @@ openapi: get /v1/notifications

<RequestExample>

```kotlin Kotlin
import co.novu.Novu
import co.novu.dto.request.NotificationRequest
import co.novu.extensions.notifications

fun main() {
val novu = Novu(apiKey = "<NOVU_API_KEY>")
val notificationRequest = NotificationRequest("<CHANNELS>", "<TEMPLATES>", "<EMAILS>", "<SEARCH>");
val notifications = novu.notifications(notificationRequest)
println(notifications)
}
```

```bash cURL
curl --request GET \
--url https://api.novu.co/v1/notifications \
Expand All @@ -22,4 +35,5 @@ notificationApi = NotificationApi(url, api_key)

notifications = notificationApi.list()
```

</RequestExample>

0 comments on commit bf0174d

Please sign in to comment.