import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});
const response = await client.websites.websiteUserRoles.assign({
websiteId: '123e4567-e89b-12d3-a456-426614174000',
websiteUserRoles: [
{ roleType: 'WEBSITE_SUPER_ADMIN', walletAddress: '0x1234567890abcdef1234567890abcdef12345678' },
],
});
console.log(response.data);{
"data": "<unknown>"
}Assign roles to users for a specific website
import SnagSolutions from '@snagsolutions/sdk';
const client = new SnagSolutions({
apiKey: process.env['X_API_KEY'], // This is the default and can be omitted
});
const response = await client.websites.websiteUserRoles.assign({
websiteId: '123e4567-e89b-12d3-a456-426614174000',
websiteUserRoles: [
{ roleType: 'WEBSITE_SUPER_ADMIN', walletAddress: '0x1234567890abcdef1234567890abcdef12345678' },
],
});
console.log(response.data);{
"data": "<unknown>"
}Body
Query parameters for getWebsiteUserRoles
UUID of the website
"123e4567-e89b-12d3-a456-426614174000"
Array of website user roles
Show child attributes
Wallet address of the user
"0x1234567890abcdef1234567890abcdef12345678"
Role type of the user
WEBSITE_SUPER_ADMIN, WEBSITE_ADMIN, WEBSITE_MODERATOR, WEBSITE_API_KEY, STRATUS_API_KEY, WEBSITE_READ_ONLY_API_KEY "WEBSITE_SUPER_ADMIN"
Deletion date of the user role
"2022-01-01T00:00:00.000Z"
[
{
"walletAddress": "0x1234567890abcdef1234567890abcdef12345678",
"roleType": "WEBSITE_SUPER_ADMIN"
}
]200
Schema for postWebsiteUserRoles response
Was this page helpful?