Subscriber Periodic Synchronisation
A standard use case for this type of synchronisation is a nightly process which keeps Poppulo's system up to date with changes in your local HR or CRM system. The real time nature of the interactive synchronisation is not an issue.
Synchronising changes to Poppulo
The standard approach here is to build a set of subscribers that need to be added, updated and removed from Poppulo's system. You then submit one or more batch jobs to perform the desired actions. These batch jobs are processed in the background in the Poppulo system.
How you build this set of subscribers is up to you. A common setup is a nightly process. If your HR or CRM system supports it, the easiest way is to get a list of objects (e.g.
students) that have been added, changed or removed in the last 24 hours. This avoids synchronising unnecessary data.
These actions are managed by Poppulo's subscriber import job. Despite the name, importing subscribers can be used to update and even remove subscribers, not just create new ones.
As an example, let us imagine you have just built your list of subscribers that have changed. You have two new subscribers, three updates and one remove. You might submit a subscriber import job that looks like the following:
<subscriber_import_job> <accept_terms>true</accept_terms> <update_existing>true</update_existing> <reactivate_api_removed>false</reactivate_api_removed> <reactivate_admin_removed>false</reactivate_admin_removed> <reactivate_bounced_removed>false</reactivate_bounced_removed> <subscriber_data> <columns>email,name.first name,name.surname,Some Custom Field,permissions,status</columns> <skip_first_line>false</skip_first_line> <field_separator>comma</field_separator> <data> <!-- Subscribers to create --> email@example.com,John,Anderson,Custom Field Value 1,Newsletter,ACTIVE firstname.lastname@example.org,Jane,Smith,Custom Field Value 2,Newsletter,ACTIVE <!-- Subscribers to update --> email@example.com,Jack,Johnson,Custom Field Value 3,,ACTIVE firstname.lastname@example.org,Jill,Williams,Custom Field Value 4,,ACTIVE email@example.com,Jeff,Brown,Custom Field Value 5,,ACTIVE <!-- Subscribers to remove --> firstname.lastname@example.org,June,Davis,Custom Field Value 6,Newsletter,OPT_OUT </data> </subscriber_data> </subscriber_import_job>
When the import has been successfully created, the resulting status entity will provide a link in
resources_created to a subscriber import, an entity that represents an import in progress.
By polling this link (using the
poll_after field), you can determine when the import has completed. If desired, you can build a progress bar for an interactive client application using the values of
When the import has completed, the final import results can be inspected. For instance, if there are any subscribers not imported, a notification could be sent. Note that by performing some validation on the client side, duplicate and invalid records should be avoidable.
Note: concurrent imports in the same account are not supported.