API Reference/Notifications

Get user notifications

GET
/api/notifications
AuthorizationBearer <token>

In: header

Query Parameters

status?string
Value in"pending" | "sent" | "failed" | "read"
type?string
Value in"email" | "sms" | "push" | "in_app"
unreadOnly?boolean
page?integer
Default1
limit?integer
Default20

Response Body

curl -X GET "http://localhost:3000/api/notifications?status=pending&type=email&unreadOnly=true&page=1&limit=20"
fetch("http://localhost:3000/api/notifications?status=pending&type=email&unreadOnly=true&page=1&limit=20")
package main

import (
  "fmt"
  "net/http"
  "io/ioutil"
)

func main() {
  url := "http://localhost:3000/api/notifications?status=pending&type=email&unreadOnly=true&page=1&limit=20"

  req, _ := http.NewRequest("GET", url, nil)
  
  res, _ := http.DefaultClient.Do(req)
  defer res.Body.Close()
  body, _ := ioutil.ReadAll(res.Body)

  fmt.Println(res)
  fmt.Println(string(body))
}
import requests

url = "http://localhost:3000/api/notifications?status=pending&type=email&unreadOnly=true&page=1&limit=20"

response = requests.request("GET", url)

print(response.text)
{
  "notifications": [
    {
      "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
      "userId": "2c4a230c-5085-4924-a3e1-25fb4fc5965b",
      "subject": "string",
      "message": "string",
      "notificationType": "email",
      "status": "pending",
      "readAt": "2019-08-24T14:15:22Z",
      "createdAt": "2019-08-24T14:15:22Z"
    }
  ],
  "pagination": {
    "page": 0,
    "limit": 0,
    "total": 0,
    "totalPages": 0
  }
}