Subscribers
We recommend using this API endpoint when you need to create or update a collection of subscribers at once. Note: Since our batch APIs process requests in the background, there may be a delay.
post
https://app.bentonow.com
/api/v1/batch/subscribers
Batch Import
Below is a short example in Ruby on how you may want to utilize this import to add subscribers into the system. Whether you want to add 1 or many this endpoint should do the trick.
import.rb
import_data = [
{ email: "[email protected]", name: "Jesse", customer_id: "123", tags: "customer,mql", remove_tags: "lead" },
{ email: "[email protected]", name: "Scott", customer_id: "124" },
]
uri = URI.parse("https://app.bentonow.com/api/v1/batch/subscribers")
request = Net::HTTP::Post.new(uri)
request.basic_auth(publishable_key, secret_key)
request.body = JSON.dump({site_uuid: site_uuid, subscribers: import_data })
request.content_type = "application/json"
req_options = { use_ssl: uri.scheme == "https", }
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
http.request(request)
end
puts JSON.parse(response.body)
Copy link