Get user's notification tray items
curl --request GET \
--url https://apix.us.amity.co/api/v1/notification-tray \
--header 'Authorization: Bearer <token>'import requests
url = "https://apix.us.amity.co/api/v1/notification-tray"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apix.us.amity.co/api/v1/notification-tray', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apix.us.amity.co/api/v1/notification-tray",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apix.us.amity.co/api/v1/notification-tray"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apix.us.amity.co/api/v1/notification-tray")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v1/notification-tray")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"notificationTrayItems": [
{
"_id": "<string>",
"daySegment": "2023-11-07T05:31:56Z",
"lastSeenAt": "2023-11-07T05:31:56Z",
"lastOccurredAt": "2023-11-07T05:31:56Z",
"actors": [
{
"_id": "<string>",
"publicId": "<string>",
"lastActedAt": "2023-11-07T05:31:56Z"
}
],
"actorsCount": 123,
"targetId": "<string>",
"targetType": "<string>",
"text": "Alice and 4 others reacted to a comment on their feed",
"templatedText": "{{ userId: AlicePublicId }} and {{ text: 4 others }} reacted to a comment on their feed",
"referenceId": "<string>",
"actionReferenceId": "<string>",
"parentId": "<string>",
"rootId": "<string>",
"latestCommentId": "<string>",
"networkId": "<string>",
"notifyToUserId": "<string>",
"data": {
"communityName": "<string>"
}
}
],
"users": [
{
"userId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"_id": "<string>",
"path": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"roles": [
"<string>"
],
"permissions": [],
"displayName": "<string>",
"profileHandle": "<string>",
"description": "<string>",
"avatarFileId": "<string>",
"avatarCustomUrl": "<string>",
"flagCount": 123,
"hashFlag": {
"bits": 123,
"hashes": 123,
"hash": [
"<string>"
]
},
"metadata": {},
"isGlobalBan": true,
"isBrand": true,
"isDeleted": true
}
],
"paging": {
"limit": 123,
"next": "<string>",
"previous": "<string>"
},
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
],
"events": [
{
"eventId": "<string>",
"userId": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"publisherId": "<string>",
"publisherInternalId": "<string>",
"publisherPublicId": "<string>",
"title": "<string>",
"description": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"location": "<string>",
"externalUrl": "<string>",
"coverImageFileId": "<string>",
"originId": "<string>",
"discussionCommunityId": "<string>",
"postId": "<string>",
"path": "<string>",
"isOriginPublic": true,
"rsvpCount": 123,
"interestedCount": 123,
"tags": [
"<string>"
],
"metadata": {},
"isDeleted": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"status": "error",
"code": 400,
"message": "Bad Request."
}Notification Tray
Get user's notification tray items
Retrieves the user’s notification tray items, sorted by newest first.
- Notification tray items will be updated shortly after calling related APIs (e.g.
POST api/v4/posts) but are not real-time. - The results are cached for 30 seconds, meaning updates for new events and
lastSeenAttime may take up to 30 seconds to reflect
GET
/
api
/
v1
/
notification-tray
Get user's notification tray items
curl --request GET \
--url https://apix.us.amity.co/api/v1/notification-tray \
--header 'Authorization: Bearer <token>'import requests
url = "https://apix.us.amity.co/api/v1/notification-tray"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://apix.us.amity.co/api/v1/notification-tray', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://apix.us.amity.co/api/v1/notification-tray",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://apix.us.amity.co/api/v1/notification-tray"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://apix.us.amity.co/api/v1/notification-tray")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://apix.us.amity.co/api/v1/notification-tray")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"notificationTrayItems": [
{
"_id": "<string>",
"daySegment": "2023-11-07T05:31:56Z",
"lastSeenAt": "2023-11-07T05:31:56Z",
"lastOccurredAt": "2023-11-07T05:31:56Z",
"actors": [
{
"_id": "<string>",
"publicId": "<string>",
"lastActedAt": "2023-11-07T05:31:56Z"
}
],
"actorsCount": 123,
"targetId": "<string>",
"targetType": "<string>",
"text": "Alice and 4 others reacted to a comment on their feed",
"templatedText": "{{ userId: AlicePublicId }} and {{ text: 4 others }} reacted to a comment on their feed",
"referenceId": "<string>",
"actionReferenceId": "<string>",
"parentId": "<string>",
"rootId": "<string>",
"latestCommentId": "<string>",
"networkId": "<string>",
"notifyToUserId": "<string>",
"data": {
"communityName": "<string>"
}
}
],
"users": [
{
"userId": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"_id": "<string>",
"path": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"roles": [
"<string>"
],
"permissions": [],
"displayName": "<string>",
"profileHandle": "<string>",
"description": "<string>",
"avatarFileId": "<string>",
"avatarCustomUrl": "<string>",
"flagCount": 123,
"hashFlag": {
"bits": 123,
"hashes": 123,
"hash": [
"<string>"
]
},
"metadata": {},
"isGlobalBan": true,
"isBrand": true,
"isDeleted": true
}
],
"paging": {
"limit": 123,
"next": "<string>",
"previous": "<string>"
},
"files": [
{
"fileId": "<string>",
"fileUrl": "<string>",
"accessType": "public",
"altText": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"attributes": {
"name": "<string>",
"extension": "<string>",
"size": 123,
"mimeType": "<string>",
"metadata": {
"exif": {},
"gps": {},
"height": 123,
"width": 123,
"isFull": true
}
}
}
],
"events": [
{
"eventId": "<string>",
"userId": "<string>",
"userInternalId": "<string>",
"userPublicId": "<string>",
"publisherId": "<string>",
"publisherInternalId": "<string>",
"publisherPublicId": "<string>",
"title": "<string>",
"description": "<string>",
"startTime": "2023-11-07T05:31:56Z",
"endTime": "2023-11-07T05:31:56Z",
"location": "<string>",
"externalUrl": "<string>",
"coverImageFileId": "<string>",
"originId": "<string>",
"discussionCommunityId": "<string>",
"postId": "<string>",
"path": "<string>",
"isOriginPublic": true,
"rsvpCount": 123,
"interestedCount": 123,
"tags": [
"<string>"
],
"metadata": {},
"isDeleted": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}{
"status": "error",
"code": 400,
"message": "Bad Request."
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Pagination options for controlling result set size and navigation
Show child attributes
Show child attributes
Response
Response containing a list of notification tray items and associated data
List of notification items to display
Show child attributes
Show child attributes
User information for actors referenced in the notifications
Show child attributes
Show child attributes
Pagination information for navigating through results
Show child attributes
Show child attributes
File information for any media referenced in notifications
Show child attributes
Show child attributes
Event information for any events referenced in notifications (omitted when there are none)
Show child attributes
Show child attributes
⌘I