API DOCUMENTATION Last Update: Apr 2022

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:

  1. $data['API'] = '1.5';
  2. $data['user_id'] = 'john1970';
  3. $data['user_password'] = '1959caadac9b13dcb3';
  4. $data['account_id'] = 'greatwidgets';
  5. $data['type'] = 'campaign_users';
  6. $data['action'] = 'remove';
  7. $data['campaign_id'] = '1234567890123456';
  8. $data['users_list'] = 'user1,user2,user3,user4,user5';

 

Success XML Response:

  1. <response status="success">
  2. <users_removed>
  3. <user>user1</user>
  4. <user>user2</user>
  5. <user>user3</user>
  6. <user>user5</user>
  7. </users_removed>
  8. </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:

  1. <response status="error">
  2. <error>Error message</error>
  3. </response>