updateUser()

Pixelsilk API function to edit a user--requires the access-users permission
Parameters:
username: the user's username (for logging in)
emailAddress: the user's email address
firstName: the user's first name
lastName: the user's last name
password: the user's password (for logging in)
roles: the id's for the user's assigned roles
id: the user's id

Output:
The function updateUser returns void

C# Example:
string username = "userName";
string emailAddress = "user@domain.topDomain";
string firstName = "userFirstName";
string lastName = "userLastName";
string password = "userPassword";
Guid[] roles = <roles id collection>;
string id = "userId";
UpdateUser(username, emailAddress, firstName, lastName, password, roles, id);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/updateUser HTTP/1.1
HOST: www.example.com
Content-Length: 433
Content-Type: application/x-www-form-urlencoded
Cookie: auth=AE03E4ACC923...2DB863D21650

Request Data:
Unencoded Data:
json={
   "username":"exampleuser",
   "emailAddress":"user@example.com",
   "firstName":"Example",
   "lastName":"User",
   "password":"pw",
   "roles":[
      "28702460-372d-4815-a594-92b9864b1085"
   ],
   "id":"04e39fbe-a494-48aa-b7d4-70932ab3602b"
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
json=%7b%0d%0a+++...%22%0d%0a%7d&token=7AdbNHZQBtwc...TEK8UvSUQ%3d

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

Response Data:
{}

JavaScript Example:
Method Call:
pixelsilk2.updateUser(input, callback);

Input Object:
{
    "username":"bsmith",
    "emailAddress":"bsmith@example.com",
    "firstName":"Bill",
    "lastName":"Smith",
    password:"pw",
    "roles":[
        "b475f3b3-987a-4ab6-ac8b-5ece7899ad12"
    ],
    "id":"1041725a-abe3-4764-bd84-99428dcb8952"
}

Returned Data:
{}

Back to Users »