Remove Users from Campaign
Allows a batch (list) of users to be removed from having permission to access a particular campaign.
The data to be submitted to the API is composed of the following fields:
|
|
field |
|
Example |
|
Note |
|
|
|
API |
|
1.6 |
|
|
|
|
|
user_id |
|
john1970 |
|
Required |
|
|
|
user_api_key |
|
1959ca5645adac9b13dcb3 |
|
Required |
|
|
|
account_id |
|
greatwidgets |
|
Required |
|
|
|
type |
|
campaign_users |
|
Required |
|
|
|
action |
|
remove |
|
Required |
|
|
|
campaign_id |
|
01234567890123456 |
|
Required |
|
|
|
users_list |
|
user1, user2, user3, etc |
|
Required |
|
|
|
|
|
|
|
|
|
|
|
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:
- There must be only ONE campaign_id.
- The usernames in the users_list must be separated by a comma. Extra spaces will be trimmed, so don't worry about them.
Example PHP Request:
If you are using PHP, the $data array would look like this:
- $data['API'] = '1.5';
- $data['user_id'] = 'john1970';
- $data['user_password'] = '1959caadac9b13dcb3';
- $data['account_id'] = 'greatwidgets';
- $data['type'] = 'campaign_users';
- $data['action'] = 'remove';
- $data['campaign_id'] = '1234567890123456';
- $data['users_list'] = 'user1,user2,user3,user4,user5';
Success XML Response:
- <response status="success">
- <users_removed>
- <user>user1</user>
- <user>user2</user>
- <user>user3</user>
- <user>user5</user>
- </users_removed>
- </response>
NOTES:
- Only the users that were actually removed from that campaign's permissions will be shown on the return XML. The following are reasons why a username is not returned:
- The username is not valid, does not exist, or not associated with the account_id given.
- The username never had permissions to access the campaign_id given.
- The username is the "owner" id, or an "admin" level role, which always has access to all campaigns.
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|