Users List
Returns a list of the users for an account.
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
API |
|
1.6 |
|
Required |
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_api_key |
|
1959caadac9b13dcb3 |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
type |
|
users_list |
|
Required |
|
|
|
|
|
|
|
|
|
|
|
searchField |
|
user_first_name or
user_last_name
user_full_name
user_role
user_name
language
timezone
user_custom1
|
|
Optional |
|
|
|
searchOper |
|
eq (equal)
ne (not equal)
bw (begins with)
bn (does not begin with)
ew (ends with)
en (does not end with)
cn (contains)
nc (does not contain)
nu (is null/empty)
nn (is not null/empty)
in (is in - comma-separated list)
ni (is not in - comma-separated list)
|
|
Optional |
|
|
|
searchValue |
|
Toronto or
LAX_
|
|
Optional |
|
|
|
|
|
|
|
|
|
|
|
sortField |
|
user_first_name or
user_last_name
user_role
user_name
language
timezone
user_custom1
|
|
Optional |
|
|
|
sortOrder |
|
DESC or
ASC
|
|
Optional |
|
|
|
|
|
|
|
|
|
|
|
offset |
|
0 |
|
Optional |
|
|
|
length |
|
10 |
|
Optional |
|
|
|
|
|
|
|
|
|
|
|
show_permissions |
|
Yes |
|
Optional or
don't include |
|
|
|
|
|
|
|
|
|
|
|
Output Format: |
|
|
|
output |
|
JSON or XML |
|
Optional. If not provided, defaults to XML |
|
|
|
callback |
|
someFunctionName |
|
Optional: JSONP format |
|
|
|
condensed |
|
yes |
|
Optional (No white space) Applies only to JSON(P) output |
|
|
|
|
|
|
|
|
|
Notes:
- Only Admin-level users or account "owner" credentials can make this call.
- The field "user_full_name" allows for restricting the list of users based on the first and last name together. The field "user_name" is the username of the user for login credentials. For example:
- First Name: John
- Last name: Smith
- Therefore, user_full_name = "John Smith"
- The user_name on the other hand, could be "jsmith123"
- The user_role is based on the roles listed in the User Permission Levels reference page.
- To also return the list of permissions the user is subject to, include the show_permissions parameter and set it to Yes. It will only include the entries that user has permissions for, not the full list of permissions. If the parameter is not included, the permissions list will not be returned. Note: The resulting XML file can be quite long if you have a lot of users.
Example PHP Request for a full, unordered list of all users without permissions details:
If you are using PHP, the $data array would look like this:
- $data['API'] = '1.5';
- $data['user_id'] = 'john1970';
- $data['user_api_key'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'users_list';
Success XML Response:
- <response status="success">
- <pagination>
- <total>12</total>
- </pagination>
- <users>
- <user>
- <user_id>janecashier</user_id>
- <user_first_name>Jane</user_first_name>
- <user_last_name>Cashier</user_last_name>
- <user_api_key>p2345khkl235hkufbfdivsdf</user_api_key>
- <user_PIN>1234</user_PIN>
- <user_addtl_info>London</user_addtl_info>
- <user_language>EN<user_language>
- <user_timezone>15</user_timezone>
- <user_role>K</user_role>
- <user_allowed_campaigns status="some">
- <campaign_id>1234567890123456</campaign_id>
- <campaign_id>2345678901234567</campaign_id>
- ...
- </user_allowed_campaigns>
- </user>
- <user>
- <user_id>joeclerky</user_id>
- <user_first_name>Joe</user_first_name>
- <user_last_name>Clerky</user_last_name>
- <user_password>p4sf8nvrdr8vhsd98erkerte</user_password>
- <user_PIN>9876</user_PIN>
- <user_addtl_info>New York</user_addtl_info>
- <user_language>EN<user_language>
- <user_timezone>15</user_timezone>
- <user_role>K</user_role>
- <user_allowed_campaigns status="all">
- </user_allowed_campaigns>
- </user>
- ...
- </users>
- </response>
Notes:
- The user_allowed_campaigns status can consisting of:
- "all" to indicated that all campaigns are allowed access
- "none" to indicate no access to none of the account campaigns (rare)
- "some" to indicate multiple entries of campaign IDs (as in example above)
Example PHP Request for a partial, ordered list matching users with permissions details:
If you are using PHP, the $data array would look like this:
- $data['API'] = '1.5';
- $data['user_id'] = 'john1970';
- $data['user_api_key'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'users_list';
- $data['searchField'] = 'user_custom1';
- $data['searchOper'] = 'cn';
- $data['searchOper'] = 'London';
- $data['sortField'] = 'user_first_name';
- $data['sortOrder'] = 'ASC';
- $data['offset'] = '0';
- $data['length'] = '10';
- $data['show_permissions'] = 'Yes';
Success XML Response:
- <response status="success">
- <pagination>
- <total>5</total>
- <offset>0</offset>
- <length>10</length>
- </pagination>
- <users>
- <user>
- <user_id>janecashier</user_id>
- <user_first_name>Jane</user_first_name>
- <user_last_name>Cashier</user_last_name>
- <user_api_key>p2345khkl235hkufbfdivsdf</user_api_key>
- <user_PIN>1234</user_PIN>
- <user_addtl_info>London</user_addtl_info>
- <user_language>EN<user_language>
- <user_timezone>15</user_timezone>
- <user_role>K</user_role>
- <user_permissions>
- <view_account_info>Yes</view_account_info>
- <view_promotions>Yes</view_promotions>
- ...
- </user_permissions>
- <user_allowed_campaigns status="some">
- <campaign_id>1234567890123456</campaign_id>
- <campaign_id>2345678901234567</campaign_id>
- ...
- </user_allowed_campaigns>
- </user>
- ...
- </users>
- </response>
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|