URLs
POST (Header: DELETE) api.ashx/v2/groups/{groupid}/members/{userid}.xml (or .json)
DELETE a group membership from a group by user id. This endpoint is deprecated, use /groups/{groupid}/members/users/{userid}.{format} instead.
POST (Header: DELETE) api.ashx/v2/groups/{groupid}/members/{username}.xml (or .json)
DELETE a group membership from a group by username. This endpoint is deprecated, use /groups/{groupid}/members/users/{username}.{format} instead.
POST (Header: DELETE) api.ashx/v2/groups/{groupid}/members/roles/{roleid}.xml (or .json)
DELETE a group membership from a group by role id.
POST (Header: DELETE) api.ashx/v2/groups/{groupid}/members/roles/{rolename}.xml (or .json)
DELETE a group membership from a group by role name.
POST (Header: DELETE) api.ashx/v2/groups/{groupid}/members/users/{userid}.xml (or .json)
DELETE a group membership from a group by user id.
POST (Header: DELETE) api.ashx/v2/groups/{groupid}/members/users/{username}.xml (or .json)
DELETE a group membership from a group by username.
Request Parameters
Name | Type | Description | Required | Default | Options |
---|---|---|---|---|---|
GroupId | int | Group Id | Required | ||
UserId | int? | Either UserId or Username is required when removing a user. | Optional | ||
Username | string | Either UserId or Username is required when removing a user. | Optional | ||
RoleId | int? | Either RoleId or Rolename is required when removing a role. | Optional | ||
Rolename | string | Either RoleId or Rolename is required when removing a role. | Optional |
Example Requests
C# REST SDK
This example uses the REST SDK to access the Community REST API within a .Net C# application. In the example, USER_NAME
is the user name of the effective user for the request and OAUTH_CLIENT_ID
and OAUTH_SECRET
are the OAuth client ID and secret, respectively, associated to this application as configured in Administration > Integration > OAuth Clients with the "Client Credentials" grant type enabled. See the documentation for the REST SDK for more details about installation, configuration, and usage options.
var host = new ClientCredentialsRestHost("USER_NAME", "https://mysite.com/", "OAUTH_CLIENT_ID", "OAUTH_SECRET"); var response = host.DeleteToDynamic(2, "groups/{groupid}/members/{userid}.json", false, new RestDeleteOptions { PathParameters = new System.Collections.Specialized.NameValueCollection { { "groupid", "6" }, { "userid", "6" } } });
Widget Javascript
This example uses the rest JavaScript API to access the Community REST API within the Community web UI. When accessing the REST API through the javascript API, the effective user is the current contextual user of the web interface.
jQuery.telligent.evolution.del({ url: jQuery.telligent.evolution.site.getBaseUrl() + 'api.ashx/v2/groups/{groupid}/members/{userid}.json', data: { 'groupid': '6', 'userid': '6' }, success: function(response) { } });
cURL
This example uses the cURL command-line HTTP utility. ENCODED_TOKEN
in the example is the base64-encoded concatenation of the user's API key (created from the user's profile), a colon (:), and the user's user name. Learn more about using the REST API.
curl -H "Rest-User-Token: ENCODED_TOKEN" -H "Rest-Method: DELETE" -X POST https://mysite.com/api.ashx/v2/groups/6/members/6.xml
Example Responses
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> </Response>
JSON
{ "Info": [ "string", "string" ], "Warnings": [ "string", "string" ], "Errors": [ "string", "string" ] }