Skip to main content

site/roles/{roleid} (GET)


Retrieve a role

  • REST Method: GET
  • Method Access: public

Uri Parameters

Name Type Description
roleid string either an integer role ID or "=" followed by a double uri-encoded role name

Query Parameters

Name Type Description
authenticate bool? Force authentication for request (default: false)

Return Codes

Name Value Description
OK 200 The request completed successfully
Bad Request 400 Invalid input parameter or request body
Not Found 404 Requested role could not be found

Message Format


    <operations mask="{int}">{text}</operations> 
    <role id="{int}" href="{uri}">{text}</role> 

Implementation Notes

Use GET:site/operations to retrieve a list of all operations currently defined on the site. 

C# Code Sample: Retrieve Role Information

The following code example retrieves information about the Admin role:

Sample Code

Plug p = Plug.New("http://deki-hayes/@api/deki");
p.At("users", "authenticate").WithCredentials("admin", "password").Get();
p.At("site", "roles", "=Admin").Get();

Sample Response from executing Code

    <role id="5" href="http://deki-hayes/@api/deki/site/roles/5">Admin</role> 

Implementation notes 

Add notes about requirements or config values

Curl Code Sample: Retrieve Role Information

The following command retrieves information regarding role "foo":

Sample Code

curl -u username:password -i http://mindtouch.address/@api/deki/site/roles/=foo

Sample Response from executing Code

Sample response from running the command on role "Contributor":

Content-Type: application/xml

  <role id="4" href="">Contributor</role>

Implementation notes 

curl flags

Provides external user authentication. Note that if anonymous access is available and authentication is not forced, this flag may be omitted.
Outputs the HTTP response headers. Useful for debugging.


To view a list of roles, follow the instructions here.
  • Was this article helpful?