Add Users to Campaign
Allows a batch (list) of users to be given permission to access a particular campaign all at once.
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 |
|
add |
|
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'] = 'add';
- $data['campaign_id'] = '1234567890123456';
- $data['users_list'] = 'user1,user2,user3,user4,user5';
Success XML Response:
- <response status="success">
- <users_added>
- <user>user1</user>
- <user>user2</user>
- <user>user3</user>
- <user>user5</user>
- </users_added>
- </response>
NOTES:
- Only the users that were actually added that campaign's access 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 already has permissions to access the campaign_id given.
- The username is the "owner" id, which always has access to all campaigns.
Error XML Response:
- <response status="error">
- <error>Error message</error>
- </response>
|