Subscriber
This service contains base operations with subscribers in Newsberry
The following operations are supported. For a formal definition, please review the Service Description.
-
Activate
Activate the inactive subscriber. Not all inactive subscribers can be activated. For instance, if the user unsubscribed from subscription then the system will not allow to make it active again.Input Parameters:
licenseKey - the key that allow to use API. You can get it from your account page
listName - name of the list where the subscriber will be added
email - the subscriber’s email
Returns:
Result object that contain status of operation:
• Success – means that subscriber was activated
• Warn – means that subscriber was found but something happened during retrieving its information.
• Fail – means that subscriber was either not found or can't be activated. The reason is returning in “Message” parameter of returning object -
Add
Adds specified subscriber to the list. If the subscriber is exists, then all its fields will be updated with new dataInput Parameters:
licenseKey - the key that allow to use API. You can get it from your account page
listName - name of the list where the subscriber will be added
email - the subscriber’s email
name - the subscriber’s name
Returns:
Result object that contain status of operation:
• Success – means that subscriber was added to the list
• Warn – means that subscriber is already exists in the list and its name was updated with new value
• Fail – means that subscriber was not added. The reason is returning in “Message” parameter of returning object -
AddWithFields
Adds specified subscriber to the list. Additional fields can be passed. If the subscriber is exists, then all its fields will be updated with new dataInput Parameters:
licenseKey - the key that allow to use API. You can get it from your account page
listName - name of the list where the subscriber will be added
email - the subscriber’s email
name - the subscriber’s name
customFields - collection of custom fields each of them contains 'Name' and 'Value' properties. First of all the system will try to find the field with the name specified in 'Name' property and update its value with 'Value'. If the column is not exists for the list, the system will create it
Returns:
Result object that contain status of operation:
• Success – means that subscriber was added to the list
• Warn – means that subscriber is already exists in the list and its name was updated with new value.
• Fail – means that subscriber was not added. The reason is returning in “Message” parameter of returning object -
Deactivate
Deactivates the subscriber.Input Parameters:
licenseKey - the key that allow to use API. You can get it from your account page
listName - name of the list where the subscriber will be added
email - the subscriber’s email
Returns:
Result object that contain status of operation:
• Success – means that subscriber was deactivated
• Fail – means that subscriber was either not found or can't be deactivated. The reason is returning in “Message” parameter of returning object -
Get
Returns subscriber with all fields and information about his statusInput Parameters:
licenseKey - the key that allow to use API. You can get it from your account page
listName - name of the list where the subscriber will be added
email - the subscriber’s email
Returns:
Result object that contain status of operation:
• Success – means that subscriber was found
• Warn – means that subscriber was found but something happening during retrieving its information.
• Fail – means that subscriber was not found or there was critical error during retrieving the subscriber. The reason is returning in “Message” parameter of returning objectEmail - email address of the subscriber
Name - full name of the subscriber
IsActive - true of false , describes if the subscriber is active in the list
InactiveReason - if the subscriber is inactive then its return the reason
CustomFields - collection of custom fields each of them contains 'Name' and 'Value' properties with data for the subscriber.
-
SynchronizeSubscribers
Synchronize passed list of subscribers with existing list in the system.
During processing the system checks each passed email and doing according to the next rules:- If the email is not exist in the list then the system adds it
- If the email is already exists in the list then it updates subscriber's data according to passed columns and makes it active if its possible
- If the list that already exists in the system contains emails that not contain in passed list, then the system deactivates them
Input Parameters:
licenseKey - the key that allow to use API. You can get it from your account page
listName - name of the list where the subscriber will be added
emailsList - list of emails and custom fields. The subscriber's email and custom fields should be coma separated. To separate subscriber's data from another subscriber's data use end line and return carette symbols (ASCII codes 10 and 13)
columnsList - coma separated list of custom fields that should be used to import data from emailsList. You can use your list's "Fields and forms" page to identify the column names.If the field is not existing yet, then the system will create it.
Returns:
Result object that contain status of operation:
• Success – means that subscribers was syncronized
• Fail – means that subscribers was not syncronized. The reason is returning in “Message” parameter of returning object -
SynchronizeSubscribers2
Synchronize passed list of subscribers with existing list in the system.
During processing the system checks each passed email and doing according to the next rules:- If the email is not exist in the list then the system adds it
- If the email is already exists in the list then it updates subscriber's data according to passed columns and makes it active if its possible
- If the list that already exists in the system contains emails that not contain in passed list, then the system deactivates them
Input Parameters:
licenseKey - the key that allow to use API. You can get it from your account page
listName - name of the list where the subscriber will be added
emailsList - list of emails and custom fields. The subscriber's email and custom fields should be coma separated. To separate subscriber's data from another subscriber's data use end line and return carette symbols (ASCII codes 10 and 13)
columnsList - coma separated list of custom fields that should be used to import data from emailsList. You can use your list's "Fields and forms" page to identify the column names.If the field is not existing yet, then the system will create it.
makeInactive - true or false - tells if make the rest of subs that are not in the synced list inactive or not
Returns:
Result object that contain status of operation:
• Success – means that subscribers was syncronized
• Fail – means that subscribers was not syncronized. The reason is returning in “Message” parameter of returning object