REST API

REST API

Legacy Poppulo platform REST API

Subscriber Import

Overview

This is a Subscriber Import. It is the result of submitting a Subscriber Import Job entity. It contains information about how the import was specified, and also the results of the import. The import has a status attribute, indicating if it is ongoing or finished.

Imports in progress

The import will have the status attribute set to IN_PROGRESS in this state. The progress sub-tag of this entity is output while the import is running. The information here can be used to build a progress bar. The ping_after field represents the time you should wait before polling again. Failing to observe this recommendation can result in rate limiting responses being returned.

Completed imports

Imports that complete successfully will have COMPLETED as their status attribute. Not all records need to be successful for an import to be considered to complete successfully

Cancelled imports

Imports can be cancelled using the Poppulo Web Application. Please note that there is no way to cancel an import using this API. Imports will have a status of CANCELLED in this case.

Error imports

If a fatal error occurred before the import could begin processing subscribers, the import will end in this state. The status will be ERROR.

Attributes

NameDescriptionType
createdThe date the corresponding import job was submittedDate
statusThe status of the import, as described aboveEnumeration of IN_PROGRESS, COMPLETED, ERROR, CANCELLED

Organisational Elements

A subscriber import is made up of three important sub-elements.

The progress element is output when status is IN_PROGRESS.

Progress Fields

Field nameDescriptionType/Allowed values
total_recordsThe number of subscriber records in the importNumber
records_processedThe number of records that have been processed so farNumber
ping_afterThe next time the client should request the current import stateDate

The results element is output when status is COMPLETED, CANCELLED or ERROR.

Results Fields

Field nameDescriptionType/Allowed values
total_recordsThe number of subscriber records in the importNumber
new_subscribersThe number of subscriber records added during this importNumber
updated_subscribersThe number of subscriber records updated during this importNumber
invalid_subscribersThe number of subscriber records rejected during this import, typically due to validation failuresNumber
duplicate_subscribersThe number of subscriber records skipped because the email address had already been processed earlier in this importNumber
previously_opted_outThe number of subscriber records skipped because the subscriber indicates they no longer wish to receive emailsNumber
invalid_subscribersA link to the call to obtain a CSV file with the subscribers who were not imported (see related calls below)Link

The specification element is always output. The meaning of the tags is identical to those in the Subscriber Import Job Entity. The only difference is the contents of the data is omitted.

Examples

Import in Progress:

    <subscriber_import created="datetime" status="IN_PROGRESS" uri="https://api.newsweaver.com/v2/test-account/subscriber_import/6732468">
    <progress>
        <total_records>5000</total_records>
        <records_processed>1234</records_processed>
        <ping_after>2012-01-11T16:41:13Z</ping_after>
    </progress>
    <specification>
        <accept_terms>true</accept_terms>
        <update_existing>true</update_existing>
        <reactivate_api_removed>true</reactivate_api_removed>
        <reactivate_admin_removed>true</reactivate_admin_removed>
        <reactivate_bounced_removed>false</reactivate_bounced_removed>
        <set_fields>
            <set_field name="source">website</set_field>
        </set_fields>
        <add_permissions>
            <permission name="Newsletter Permission" />
            <permission name="Flyer Permission" />
        </add_permissions>
        <remove_permissions>
            <permission name="Old Permission" />
            <permission name="Outdated Permission" />
        </remove_permissions>
        <tags>
            <tag name="Website Subscribers" />
            <tag name="API Subscribers" />
        </tags>
        <subscriber_data>
            <columns>email,name.first name,name.surname</columns>
            <skip_first_line>true</skip_first_line>
            <field_separator>comma</field_separator>
        </subscriber_data>
    </specification>
</subscriber_import>

Completed Import:

500013004000100200400truetruetruetruefalsewebsiteemail,name.first name,name.surnametruecomma

See calls: