API Reference
Interactive API docs located at: https://api.v2.walletchat.fun/docs/index.html
Full API reference is included here, subsections are broken out in the navigate pane. Current API version is: https://api.v2.walletchat.fun
Every call the to API after this signin should present the JWT Bearer token for authenticated access. Upon request we can change the timeout to greater than 24 hours, or setup an addtional dedicated API for an agreed upon development and maintenance cost
OK
POST /signin HTTP/1.1
Host:
Content-Type: application/json
Accept: */*
Content-Length: 73
{
"address": "text",
"msg": "text",
"name": "text",
"nonce": "text",
"sig": "text"
}OK
1As part of the login process, we need a user to sign a nonce genrated from the API, to prove the user in fact the owner of the wallet they are siging in from. JWT currently set to 24 hour validity (could change this upon request)
wallet address to get nonce to sign
OK
GET /users/{address}/nonce HTTP/1.1
Host:
Accept: */*
OK
No content
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"
}
]For DMs, Chatitem data struct is used to store each message and associated info. REQUIRED: fromaddr, toaddr, message (see data struct section at bottom of page for more detailed info on each paramter) Other fields are generally filled in by the backed REST API and used as return parameters ID is auto generated and should never be used as input.
USE IF USING LIT ENCRYPTION
*** REQUIRED INPUT ***
AUTO-GENERATED (PRIMARY KEY)
*** REQUIRED INPUT ***
ONLY USED FOR NFT DM CONTEXT
ONLY USED FOR NFT DM CONTEXT
DEFAULT FALSE
AUTO-SET BY BACKED FOR RETURN VALUE
AUTO-SET BY REST API
USED FOR SORTING WHEN TIME FORMAT NEEDED
*** REQUIRED INPUT ***
OK
POST /v1/create_chatitem HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 228
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Comments are meant to be public, someday having an up/downvote method for auto-moderation
OK
POST /v1/create_comments HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 103
{
"fromaddr": "text",
"id": 1,
"message": "text",
"name": "text",
"nftaddr": "text",
"nftid": 1,
"timestamp": "text"
}OK
[
{
"fromaddr": "text",
"id": 1,
"message": "text",
"name": "text",
"nftaddr": "text",
"nftid": 1,
"timestamp": "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"
}
]Can only delete messages sent, cannot delete incoming messages
message ID
No Content
No content
DELETE /v1/delete_chatitem/{id} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
No Content
No content
NFTs have a public comment section
FROM Wallet Address
NFT Contract Address
NFT ID
No Content
No content
DELETE /v1/delete_comments/{fromaddr}/{nftaddr}/{nftid} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
No Content
No content
Currently deletes all chat items between these two addresses
TO: Address
FROM: Address
No Content
No content
DELETE /v1/deleteall_chatitems/{fromaddr}/{toaddr} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
No Content
No content
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
NFTs have a public comment section
Wallet Address
OK
GET /v1/get_comments/{nftaddr}/{nftid} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"fromaddr": "text",
"id": 1,
"message": "text",
"name": "text",
"nftaddr": "text",
"nftid": 1,
"timestamp": "text"
}
]NFTs have a public comment section
NFT Contract Address
NFT ID
OK
GET /v1/get_comments_cnt/{nftaddr}/{nftid} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
1Get 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
1Get Each 1-on-1 Conversation, NFT and Community Chat For Display in Inbox
Wallet Address
OK
GET /v1/get_inbox/{address} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"chain": "text",
"context_type": "text",
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"logo": "text",
"message": "text",
"name": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text",
"type": "text",
"unread": 1
}
]TODO: not yet used
Wallet Address
OK
GET /v1/get_settings/{address} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"domain": "text",
"email": "text",
"id": 1,
"notify24": "text",
"notifydm": "text",
"signupsite": "text",
"verified": "text",
"walletaddr": "text"
}
]Get all unread messages TO a specific user, used for total count notification at top notification bar
Get Each 1-on-1 Conversation, NFT and Community Chat For Display in Inbox
Wallet Address
OK
GET /v1/get_unread_cnt/{address} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
1Get Unread count for specifc NFT context given a wallet address and specific NFT
Wallet Address
NFT Contract Address
NFT ID
OK
GET /v1/get_unread_cnt/{address}/{nftaddr}/{nftid} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
1Get Unread count for DMs
TO: Wallet Address
FROM: Wallet Address
OK
GET /v1/get_unread_cnt/{fromaddr}/{toaddr} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
1Get all unread messages TO a specific user, used for total count notification at top notification bar
Get Each 1-on-1 Conversation, NFT and Community Chat For Display in Inbox
Wallet Address
Message Type - nft|community|dm|all
OK
GET /v1/get_unread_cnt_by_type/{address}/{type} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
1Get Unread count for all NFT contexts given a wallet address
Wallet Address
OK
GET /v1/get_unread_cnt_nft/{address} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
1Get all Chat Items for DMs for a given wallet address
Wallet Address
OK
GET /v1/getall_chatitems/{address} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Get chat data between the given two addresses, TO and FROM and interchangable here
TO: Wallet Address
FROM: Wallet Address
OK
GET /v1/getall_chatitems/{fromaddr}/{toaddr} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Get chat data between the given two addresses, TO and FROM and interchangable here
TO: Wallet Address
FROM: Wallet Address
Load only messages after this time
OK
GET /v1/getall_chatitems/{fromaddr}/{toaddr}/${time} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Get ALL NFT context items for a given wallet address
Wallet Address
OK
GET /v1/getnft_chatitems/{address} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Get all specified NFT contract and ID items for a given wallet address
Wallet Address
NFT Contract Address
NFT ID
OK
GET /v1/getnft_chatitems/{address}/{nftaddr}/{nftid} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Get NFT Related Chat Items For Given NFT Contract and ID, between two wallet addresses (TO and FROM are interchangable)
Get ALL NFT context items for a specifc NFT context convo between two wallets
NFT Contract Address
NFT ID
TO: Wallet Address
FROM: Wallet Address
OK
GET /v1/getnft_chatitems/{fromaddr}/{toaddr}/{nftaddr}/{nftid} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Get ALL NFT context items for a given wallet address
NFT Contract Address
NFT ID
OK
GET /v1/getnft_chatitems/{nftaddr}/{nftid} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Get newly read messages to update READ status for lazy loading
TO: Wallet Address
FROM: Wallet Address
OK
GET /v1/getread_chatitems/{fromaddr}/{toaddr} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Currently used for the WC HQ Logo, stores the base64 raw data of the profile image for a community
OK
POST /v1/image HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 42
{
"addr": "text",
"base64data": "text",
"id": 1
}OK
[
{
"addr": "text",
"base64data": "text",
"id": 1
}
]Currently used for the WC HQ Logo, stores the base64 raw data of the profile image for a community
OK
PUT /v1/image HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 42
{
"addr": "text",
"base64data": "text",
"id": 1
}OK
[
{
"chain": "text",
"id": 1,
"nftaddr": "text",
"walletaddr": "text"
}
]Retreive image data for use with user/community/nft group dislayed icon
Wallet/NFT Address Mapped to User/Community
OK
GET /v1/image/{addr} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"addr": "text",
"base64data": "text",
"id": 1
}
]public facing PFP storage to make it faster for UI to get and load images
OK
POST /v1/imagepfp HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 42
{
"addr": "text",
"base64data": "text",
"id": 1
}OK
[
{
"addr": "text",
"base64data": "text",
"id": 1
}
]API user could check this directly via any third party service like NFTPort, Moralis as well
NFT Contract Address
Wallet Address
OK
GET /v1/is_owner/{contract}/{wallet} 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"
}
}
]
}
]Give a common name (Kevin.eth, BillyTheKid, etc) to an Address
ADDRESS
DOMAIN
NAME
SITE USER SIGNED UP FROM
OK
POST /v1/name HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 75
{
"address": "text",
"domain": "text",
"id": 1,
"name": "text",
"signupsite": "text"
}OK
1get the given a common name (Kevin.eth, BillyTheKid, etc) what has already been mapped to an Address
Get Name for given address
OK
GET /v1/name/{name} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
[
{
"address": "text",
"id": 1,
"name": "text"
}
]Get all unread messages TO a specific user, used for total count notification at top notification bar
Get Unread count just given an address
Wallet Address
OK
GET /v1/unreadcount/{address} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Accept: */*
OK
1Currently this only update the message read/unread status. It could update the entire JSON struct upon request, however we only needed this functionality currently and it saved re-encryption of the data. TODO: TO/FROM address in the URL is not needed/not used anymore.
USE IF USING LIT ENCRYPTION
*** REQUIRED INPUT ***
AUTO-GENERATED (PRIMARY KEY)
*** REQUIRED INPUT ***
ONLY USED FOR NFT DM CONTEXT
ONLY USED FOR NFT DM CONTEXT
DEFAULT FALSE
AUTO-SET BY BACKED FOR RETURN VALUE
AUTO-SET BY REST API
USED FOR SORTING WHEN TIME FORMAT NEEDED
*** REQUIRED INPUT ***
OK
PUT /v1/update_chatitem/{fromaddr}/{toaddr} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 228
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}OK
[
{
"encrypted_sym_lit_key": "text",
"fromaddr": "text",
"id": 1,
"lit_access_conditions": "text",
"message": "text",
"nftaddr": "text",
"nftid": "text",
"read": true,
"sender_name": "text",
"timestamp": "text",
"timestamp_dtm": "text",
"toaddr": "text"
}
]Update settings, email address, daily notifications and per DM notifications
DOMAIN
Publickey string json:"publickey"
AUTO-GENERATED (PRIMARY KEY)
RECEIVE NOTIFICATION FOR EVERY DM RECEIVED (string value true/false)
RECEIVE DAILY NOTIFICATION SUMMARY EMAIL (string value true/false)
LATEST SITE WHERE NOTIFICATIONS EMAIL WAS ENTERED
USER CONFIRMED EMAIL OR NOT (string value true/false)
*** REQUIRED INPUT ***
OK
POST /v1/update_settings HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 133
{
"domain": "text",
"email": "text",
"id": 1,
"notify24": "text",
"notifydm": "text",
"signupsite": "text",
"verified": "text",
"walletaddr": "text"
}OK
[
{
"domain": "text",
"email": "text",
"id": 1,
"notify24": "text",
"notifydm": "text",
"signupsite": "text",
"verified": "text",
"walletaddr": "text"
}
]Users will get an email when signing-up to verify email, to ensure we do not send spam
DOMAIN
Publickey string json:"publickey"
AUTO-GENERATED (PRIMARY KEY)
RECEIVE NOTIFICATION FOR EVERY DM RECEIVED (string value true/false)
RECEIVE DAILY NOTIFICATION SUMMARY EMAIL (string value true/false)
LATEST SITE WHERE NOTIFICATIONS EMAIL WAS ENTERED
USER CONFIRMED EMAIL OR NOT (string value true/false)
*** REQUIRED INPUT ***
OK
GET /v1/verify_email/{email}/{verification_code} HTTP/1.1
Host:
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 133
{
"domain": "text",
"email": "text",
"id": 1,
"notify24": "text",
"notifydm": "text",
"signupsite": "text",
"verified": "text",
"walletaddr": "text"
}OK
[
{
"domain": "text",
"email": "text",
"id": 1,
"notify24": "text",
"notifydm": "text",
"signupsite": "text",
"verified": "text",
"walletaddr": "text"
}
]Last updated