APIs
Verify login code
Endpoint
/users/auth
Method
GET
Parameters
Parameters Type Description code String
Verify login code Example Value
{
"userId": "xxxxxxx",
"address": "0x44...5674",
"serverId": "1561616818083545088",
"channelId": "1562711066578907136",
"starkKey": "0x00...4c2c"
}Return Value
Parameters Type Description userId String
User ID address String
Wallet address serverId String
Current server ID channelId String
Current channel ID starkKey String
Current user starkKey
Validate user's channel-level permissions
Validate user's channel-level permissions
Endpoint
/channels/{channelId}/permissions/validate
Method
GET
Parameters
Parameters Type Description userId String
Opencord User ID group String
Resource type you want to validate the target user's permission: - 1: server
- 2: channel
- 3: membership
- 4: chat channel
- 5: voice channel
- 6: announcement channel
- 7: forum channel
- 8: guide channel
channelId String
Target channel ID permissions String
Permission value which belongs to different permission groups, if you want to verify multiple permissions, you can pass multiple permission values. For example, if you want to verify View Channels and Manage Channels permissions, you can pass "3" (1+2). - server:
- 2:Manage Roles
- channel:
- 1:View Channels
- 2:Manage Channels
- membership
- 1: Create Invites
- 2: Kick
- 4: Ban
- 8: Timeout
- chat:
- 1: Send Messages
- 2: Manage Messagess
- voice:
- 1: Speak
- 2: Manage Voices
- announcement:
- 1: Manage Announcements
- forum:
- 1: Create Posts
- 2: Reply
- 4: Manage Posts
- 8: Mentions
- guide:
- 1: Manage Messages
Example Value
{
"allowed": "5"
}Note:
int(allowed) & permission > 0
means the permission was passed.Return Value
Parameters Type Description allowed String
Validation request whether the requested permissions are satisfied.
Validate user's server-level permissions
Validate user's server-level permissions
Endpoint
/servers/{serverId}/permissions/validate
Method
GET
Parameters
Parameters Type Description userId String
Opencord User ID group String
Resource type you want to validate the target user's permission: - 1: server
- 2: channel
- 3: membership
- 4: chat channel
- 5: voice channel
- 6: announcement channel
- 7: forum channel
- 8: guide channel
serverId String
current server id permissions String
Permission value which belongs to different permission groups, if you want to verify multiple permissions, you can pass multiple permission values. For example, if you want to verify View Channels and Manage Channels permissions, you can pass "3" (1+2). - server:
- 1:Manage Overview
- 2:Manage Roles
- 4:Manage Applications
- channel:
- 1:View Channels
- 2:Manage Channels
- membership
- 1: Create Invites
- 2: Kick
- 4: Ban
- 8: Timeout
- chat:
- 1: Send Messages
- 2: Manage Messagess
- voice:
- 1: Speak
- 2: Manage Voices
- announcement:
- 1: Manage Announcements
- forum:
- 1: Create Posts
- 2: Reply
- 4: Manage Posts
- 8: Mentions
- guide:
- 1: Manage Messages
Example Value
{
"allowed": "5"
}Note:
int(allowed) & permission > 0
means you passed the permission.Return Value
Parameters Type Description allowed String
Validation request whether the requested permissions are satisfied.
Push notification
Endpoint
/notify
Method
POST
Parameters
Parameters Type Description channelId String
Current channel ID title String
Title of the notification. content String
Content of the notification jumpPath String
Path to the route that the user should be redirected to upon clicking on the notification. Example: /test receiverIds String[]
(Optional)If not provided, the notification will be sent to all users in the channel by default. Otherwise, it will be sent to the specified users.