APIs
Verify login code
Endpoint
/users/auth
Method
GET
Parameters
Parameters Type Description code StringVerify login code Example Value
{
"userId": "xxxxxxx",
"address": "0x44...5674",
"serverId": "1561616818083545088",
"channelId": "1562711066578907136",
"starkKey": "0x00...4c2c"
}Return Value
Parameters Type Description userId StringUser ID address StringWallet address serverId StringCurrent server ID channelId StringCurrent channel ID starkKey StringCurrent 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 StringResource 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 StringTarget channel ID permissions StringPermission 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 > 0means the permission was passed.Return Value
Parameters Type Description allowed StringValidation 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 StringResource 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 Stringcurrent server id permissions StringPermission 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 > 0means you passed the permission.Return Value
Parameters Type Description allowed StringValidation request whether the requested permissions are satisfied.
Push notification
Endpoint
/notify
Method
POST
Parameters
Parameters Type Description channelId StringCurrent channel ID title StringTitle of the notification. content StringContent of the notification jumpPath StringPath 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.