getUsers()

Pixelsilk API function to get the site users--requires the access-users permission
Parameters:
The function getUsers has no parameters.

Output:
The function getUsers returns an enumerable collection of users for the site

C# Example:
IEnumerable users = GetUsers();
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/getUsers HTTP/1.1
HOST: www.example.com
Content-Length: 36
Content-Type: application/x-www-form-urlencoded
Cookie: auth=42D0B1BF2B1B...D7213977466D

Request Data:
Unencoded Data:
token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=FAF445293A93...2F5277CE988; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 2790

Response Data:
[
  {
    "id":"ded14404-86b7-4cbc-b87f-116afb768e46",
    "name":"Admin",
    "username":"admin",
    "emailAddress":"",
    "firstName":"Admin",
    "lastName":"",
    "roles":[
      "28702460-372d-4815-a594-92b9864b1085"
    ]
  },
  {
    "id":"04e39fbe-a494-48aa-b7d4-70932ab3602b",
    "name":"Example User",
    "username":"exampleuser",
    "emailAddress":"user@example.com",
    "firstName":"Example",
    "lastName":"User",
    "roles":[
      "28702460-372d-4815-a594-92b9864b1085"
    ]
  }
]
Note: most of the users have been removed for better readability.

JavaScript Example:
Method Call:
pixelsilk2.getUsers(callback);

Input Object:
The function getUsers has no parameters.

Returned Data:
[
    {
        "id":"4fa0b021-1d0a-44dc-af16-b9177389e66e",
        "name":"Admin",
        "username":"admin",
        "emailAddress":"",
        "firstName":"Admin",
        "lastName":"",
        "roles":[
            "1ef0a212-1e53-4ff9-9bc7-dfb984e3396b"
        ]
    },
    {
        "id":"45ff4a44-0673-4975-8772-193e9d4d49b7",
        "name":"Example User",
        "username":"euser",
        "emailAddress":"euser@example.com",
        "firstName":"Example",
        "lastName":"User",
        "roles":[
            "d221b625-9d87-4fdf-8642-6ff88a573ed7"
        ]
    }
]
NOTE: many users were removed to make this easier to read.

Back to Users »