Group Chats (Non-NFT Related)
Group chat related API endpoints:
CreateCommunityChatitem creates GroupChatitem just with community tag (likely could be consolidated)
Community Chat Data
OK
POST /v1/community HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 159
{
"context_type": "text",
"fromaddr": "text",
"id": 1,
"message": "text",
"nftaddr": "text",
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"type": "text"
}OK
[
{
"context_type": "text",
"fromaddr": "text",
"id": 1,
"message": "text",
"nftaddr": "text",
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"type": "text"
}
]TODO: need a creation API for communities, which includes specificied welcome message text, Twitter handle, page title
Wallet Address
OK
GET /v1/community/{community}/{address} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"has_messaged": true,
"is_verified": true,
"joined": true,
"logo": "text",
"members": 1,
"messages": [
{
"context_type": "text",
"fromaddr": "text",
"id": 1,
"message": "text",
"nftaddr": "text",
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"type": "text"
}
],
"name": "text",
"social": [
{
"type": "text",
"username": "text"
}
],
"tweets": [
{
"attachments": {
"media_keys": [
"text"
]
},
"author_id": "text",
"created_at": "text",
"id": "text",
"media": {
"media_keys": [
"text"
]
},
"text": "text",
"user": {
"id": "text",
"name": "text",
"profile_image_url": "text",
"username": "text"
}
}
]
}
]Bookmarks keep an NFT/Community group chat in the sidebar
OK
POST /v1/create_bookmark HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 60
{
"chain": "text",
"id": 1,
"nftaddr": "text",
"walletaddr": "text"
}OK
[
{
"chain": "text",
"id": 1,
"nftaddr": "text",
"walletaddr": "text"
}
]Community Chat Creation
OK
POST /v1/create_community HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 61
{
"community": "text",
"social": [
{
"name": "text",
"type": "text"
}
]
}OK
[
{
"community": "text",
"social": [
{
"name": "text",
"type": "text"
}
]
}
]Currently used for all messages outside of DMs
OK
POST /v1/create_groupchatitem HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 159
{
"context_type": "text",
"fromaddr": "text",
"id": 1,
"message": "text",
"nftaddr": "text",
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"type": "text"
}OK
[
{
"context_type": "text",
"fromaddr": "text",
"id": 1,
"message": "text",
"nftaddr": "text",
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"type": "text"
}
]Bookmarks keep an NFT/Community group chat in the sidebar
OK
POST /v1/delete_bookmark HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 60
{
"chain": "text",
"id": 1,
"nftaddr": "text",
"walletaddr": "text"
}OK
[
{
"chain": "text",
"id": 1,
"nftaddr": "text",
"walletaddr": "text"
}
]This used for UI purposes, checking if a user/wallet has bookmarked a community.
Wallet Address
OK
GET /v1/get_bookmarks/{address}/ HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"chain": "text",
"id": 1,
"nftaddr": "text",
"walletaddr": "text"
}
]This used for UI purposes, checking if a user/wallet has bookmarked a community.
Wallet Address
NFT Contract Address
OK
GET /v1/get_bookmarks/{walletaddr}/{nftaddr} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
No content
Get all group chat items for a given wallet (useraddress) for a given NFT Contract Address (TODO: fix up var names)
NFT Address
FROM: wallet address
OK
GET /v1/get_groupchatitems/{address}/{useraddress} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"context_type": "text",
"fromaddr": "text",
"id": 1,
"message": "text",
"nftaddr": "text",
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"type": "text"
}
]For group chat unread counts, currently the database stores a timestamp for each time a user enters a group chat. We though in the design it would be impractical to keep a read/unread count copy per user per message, but if this method doesn't proof to be fine grained enough, we could add a boolean relational table of read messgages per user.
Common Name Mapped to User/Community
OK
GET /v1/get_groupchatitems_unreadcnt/{address}/{useraddress} HTTP/1.1
Host:
Accept: */*
OK
1Last updated