Last week we wrote about how we extended the functionality of the Paubox Marketing API by adding campaign mailings as an API endpoint.
This week we're going to cover how to add and delete contacts in bulk using the Paubox Marketing API.
In a nutshell, the Paubox Marketing API is a growing collection of API endpoints we've exposed to allow customers greater flexibility. The goal here is to make Paubox Marketing, our HIPAA compliant email marketing platform, easier to use.
{ "subscriber_ids" : "[string]", //required - will delete from default subscription list "subscription_list" : "string" //optional - populate to delete id's from specific list }Now let's see some Ruby:
def bulk_create unless params[:subscribers]&.present? render json: {} return end subs = SubscribersCreator.call( api_customer: @api_customer, subscribers_data: params[:subscribers], subscription_list_id: params[:subscription_list_id], email: params[:email] ) num_subscribers_added = subs[:created_count] render json: { data: { num_subscribers_added: num_subscribers_added, errors: subs[:errors] } } end
def bulk_delete unless params[:subscriber_ids] render json: {} return end SubscribersDeleter.call( api_customer: @api_customer, subscriber_ids: params[:subscriber_ids], subscription_list_id: params[:subscription_list_id] ) render json: {} end
Paubox Marketing is HITRUST CSF certified and is free to use for up to 100 contacts. The free plan also includes a business associate agreement.