POST api.ashx/v2/roles.{json|xml}
CREATE a role.
Scopes
Security(Roles and Permissions) › Modify Roles security.roles.modify
Request Parameters
Name | Type | Location | Description | Required | Default | Options |
---|---|---|---|---|---|---|
Description | string | Description | Required | |||
GroupId | int? | Group Id | Optional | |||
Include | string | Options for include are: user. Ex: include=user. | Optional | |||
Name | string | Name | Required | |||
RoleId | int? | Either RoleId or RoleName is required when using include=user | Optional | |||
RoleName | string | Either RoleId or RoleName is required when using include=user | Optional | |||
UserId | int? | Either UserId or Username is required when using include=user | Optional | |||
Username | string | Either UserId or Username is required when using include=user | Optional |
Example Requests
Widget Javascript
jQuery.telligent.evolution.post({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/roles.json', data: { 'Description': 'description', 'Name': 'name' } }).then(function(response) { // use response });
Example Responses
JSON
{ "Role": { "Id": 6, "RoleId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "Name": "name", "Description": "description", "GroupId": 25, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "IsPrivate": true, "PermissionEntries": [ { "Id": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true, "IsImmediate": true }, { "Id": "fe65240b-044c-4292-9946-f10e0361ecff", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true, "IsImmediate": true } ] }, "Info": [ "string", "string" ], "Warnings": [ "string", "string" ], "Errors": [ "string", "string" ] }
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <Info> <Message>string</Message> <Message>string</Message> </Info> <Warnings> <Message>string</Message> <Message>string</Message> </Warnings> <Errors> <Message>string</Message> <Message>string</Message> </Errors> <Role> <Id>6</Id> <RoleId>49fec544-6df7-4a82-872b-f8be586d5e9e</RoleId> <Name>name</Name> <Description>description</Description> <GroupId>25</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <IsPrivate>true</IsPrivate> <PermissionEntries> <PermissionEntry> <Id>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> <IsImmediate>true</IsImmediate> </PermissionEntry> <PermissionEntry> <Id>fe65240b-044c-4292-9946-f10e0361ecff</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> <IsImmediate>true</IsImmediate> </PermissionEntry> </PermissionEntries> </Role> </Response>
POST api.ashx/v2/roles/user/{userid}.{json|xml}
CREATE Add a user to a role.
Scopes
Users › Modify Role Users users.roles.modify
Request Parameters
Name | Type | Location | Description | Required | Default | Options |
---|---|---|---|---|---|---|
Description | string | Description | Required | |||
GroupId | int? | Group Id | Optional | |||
Include | string | Options for include are: user. Ex: include=user. | Optional | |||
Name | string | Name | Required | |||
RoleId | int? | Either RoleId or RoleName is required when using include=user | Optional | |||
RoleName | string | Either RoleId or RoleName is required when using include=user | Optional | |||
UserId | int? | Either UserId or Username is required when using include=user | Optional | |||
Username | string | Either UserId or Username is required when using include=user | Optional |
Example Requests
Widget Javascript
jQuery.telligent.evolution.post({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/roles/user/{userid}.json', data: { 'userid': '6', 'Description': 'description', 'Name': 'name' } }).then(function(response) { // use response });
Example Responses
JSON
{ "Role": { "Id": 6, "RoleId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "Name": "name", "Description": "description", "GroupId": 25, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "IsPrivate": true, "PermissionEntries": [ { "Id": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true, "IsImmediate": true }, { "Id": "fe65240b-044c-4292-9946-f10e0361ecff", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true, "IsImmediate": true } ] }, "Info": [ "string", "string" ], "Warnings": [ "string", "string" ], "Errors": [ "string", "string" ] }
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <Info> <Message>string</Message> <Message>string</Message> </Info> <Warnings> <Message>string</Message> <Message>string</Message> </Warnings> <Errors> <Message>string</Message> <Message>string</Message> </Errors> <Role> <Id>6</Id> <RoleId>49fec544-6df7-4a82-872b-f8be586d5e9e</RoleId> <Name>name</Name> <Description>description</Description> <GroupId>25</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <IsPrivate>true</IsPrivate> <PermissionEntries> <PermissionEntry> <Id>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> <IsImmediate>true</IsImmediate> </PermissionEntry> <PermissionEntry> <Id>fe65240b-044c-4292-9946-f10e0361ecff</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> <IsImmediate>true</IsImmediate> </PermissionEntry> </PermissionEntries> </Role> </Response>
POST api.ashx/v2/roles/user/{username}.{json|xml}
CREATE a user to a role.
Scopes
Users › Modify Role Users users.roles.modify
Request Parameters
Name | Type | Location | Description | Required | Default | Options |
---|---|---|---|---|---|---|
Description | string | Description | Required | |||
GroupId | int? | Group Id | Optional | |||
Include | string | Options for include are: user. Ex: include=user. | Optional | |||
Name | string | Name | Required | |||
RoleId | int? | Either RoleId or RoleName is required when using include=user | Optional | |||
RoleName | string | Either RoleId or RoleName is required when using include=user | Optional | |||
UserId | int? | Either UserId or Username is required when using include=user | Optional | |||
Username | string | Either UserId or Username is required when using include=user | Optional |
Example Requests
Widget Javascript
jQuery.telligent.evolution.post({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/roles/user/{username}.json', data: { 'username': 'username', 'Description': 'description', 'Name': 'name' } }).then(function(response) { // use response });
Example Responses
JSON
{ "Role": { "Id": 6, "RoleId": "49fec544-6df7-4a82-872b-f8be586d5e9e", "Name": "name", "Description": "description", "GroupId": 25, "IsSystemRole": true, "ImageUrl": "", "AvatarUrl": "avatarurl", "IsPrivate": true, "PermissionEntries": [ { "Id": "9f5a6721-639d-4e1d-ab6a-ce63b7750f46", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true, "IsImmediate": true }, { "Id": "fe65240b-044c-4292-9946-f10e0361ecff", "PermissionId": "permissionid", "Name": "name", "IsAllowed": true, "IsImmediate": true } ] }, "Info": [ "string", "string" ], "Warnings": [ "string", "string" ], "Errors": [ "string", "string" ] }
XML
<?xml version="1.0" encoding="utf-16"?> <Response> <Info> <Message>string</Message> <Message>string</Message> </Info> <Warnings> <Message>string</Message> <Message>string</Message> </Warnings> <Errors> <Message>string</Message> <Message>string</Message> </Errors> <Role> <Id>6</Id> <RoleId>49fec544-6df7-4a82-872b-f8be586d5e9e</RoleId> <Name>name</Name> <Description>description</Description> <GroupId>25</GroupId> <IsSystemRole>true</IsSystemRole> <AvatarUrl>avatarurl</AvatarUrl> <IsPrivate>true</IsPrivate> <PermissionEntries> <PermissionEntry> <Id>9f5a6721-639d-4e1d-ab6a-ce63b7750f46</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> <IsImmediate>true</IsImmediate> </PermissionEntry> <PermissionEntry> <Id>fe65240b-044c-4292-9946-f10e0361ecff</Id> <PermissionId>permissionid</PermissionId> <Name>name</Name> <IsAllowed>true</IsAllowed> <IsImmediate>true</IsImmediate> </PermissionEntry> </PermissionEntries> </Role> </Response>