Tuyu Developers

Developers

Customize the URLs on this site with your Tuyu URL:

https:// .
Method Documentation > Users and Workspaces

User List GET

Description

Lists all users on the site.

URL

All responses are in JSON format by default, to specify an XML response add “.xml” to the end of the method name (in this case “user_list”)

https://<your subdomain>.<your domain>/api/user_list

Restrictions

The calling user must have:

  • Admin privileges for the site.

Parameters

Bold indicates required. Please note parameters must be appended to the URL in alphabetical order, except for “signature”, which is always at the end.

Parameter Description
active Default is empty, which retrieves all users. Use “1“ to only retrieve active users or “0” to only retrieve non-active users.
active_directory Default is empty, which retrieves all users. Use “1“ to only retrieve ActiveDirectory users or “0” to only retrieve non-ActiveDirectory users.
admin Default is empty, which retrieves all users. Use “1“ to only retrieve admin users or “0” to only retrieve non-admin users.
api_key Your API Key.
current_page Default is “1”, only necessary to grab subsequent pages of users when the number of users in a location exceeds 50.
search Default is empty, enter a URL-encoded string to filter users based on first name, last name, e-mail address, username or organization.
sort_by Default is “lastName_asc”. Other options include “lastName_desc”, “firstName_asc”, “firstName_desc”, “email_asc”, “email_desc”, “username_asc”, “username_desc”, “created_asc”, “created_desc”, “modified_asc”, “modified_desc”
timestamp The current time in Unix timestamp format.
signature Please see “User Authentication” for more information.

Sample Response

Successful response In JSON:

{"userList":{
    "users":[
        {
            "id":1,
            "siteId":1,
            "username":"johndoe",
            "firstName":"John",
            "lastName":"Doe",
            "email":"john@doe.com",
            "organization":"Acme Inc.",
            "phone":"1234567890",
            "phoneExt":null,
            "created":"04/07/15 at 09:05 am EDT",
            "modified":"05/27/15 at 09:26 am EDT"
        },
        {
            "id":2,
            "siteId":1,
            "username":"janedoe",
            "firstName":"Jane",
            "lastName":"Doe",
            "email":"jane@doe.com",
            "organization":"Acme Inc.",
            "phone":"1234567891",
            "phoneExt":null,
            "created":"04/07/15 at 09:05 am EDT",
            "modified":"05/27/15 at 09:26 am EDT"
        }
    ],
    "totalUsers":2,
    "usersInPage":2,
    "maxUsersPage":50,
    "page":1
}
}

Successful response in XML:

<userList>
<users>
    <user>
        <id>1</id>
        <siteId>1</siteId>
        <username>johndoe</username>
        <firstName>John</firstName>
        <lastName>Doe</lastName>
        <email>john@doe.com</email>
        <organization>Acme Inc.</organization>
        <phone>1234567890</phone>
        <phoneExt>null</phoneExt>
        <created>04/07/15 at 09:05 am EDT</created>
        <modified>05/27/15 at 09:26 am EDT</modified>
    </user>
    <user>
        <id>2</id>
        <siteId>1</siteId>
        <username>"janedoe</username>
        <firstName>"Jane</firstName>
        <lastName>"Doe</lastName>
        <email>"jane@doe.com</email>
        <organization>"Acme Inc.</organization>
        <phone>"1234567891</phone>
        <phoneExt>null</phoneExt>
        <created>04/07/15 at 09:05 am EDT</created>
        <modified>05/27/15 at 09:26 am EDT</modified>
    </user>
</users>
<totalUsers>2</totalUsers>,
<usersInPage>2</usersInPage>,
<maxUsersPage>50</maxUsersPage>,
<page>1</page>
</userList>

Error response In JSON:

{"error":{
"title":"'User List Failed",
"message":"You must be an administrator to call this method"}
}

Error response In XML:

<error>
<title>'User List Failed</title>
<message>You must be an administrator to call this method</message>
</error>