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
1
import_data = [
2
{ email: "[email protected]", name: "Jesse", customer_id: "123" },
3
{ email: "[email protected]", name: "Scott", customer_id: "124" },
4
]
5
​
6
uri = URI.parse("https://app.bentonow.com/api/v1/batch/subscribers")
7
request = Net::HTTP::Post.new(uri)
8
request.basic_auth(publishable_key, secret_key)
9
request.body = JSON.dump({site_uuid: site_uuid, subscribers: import_data })
10
request.content_type = "application/json"
11
req_options = { use_ssl: uri.scheme == "https", }
12
​
13
response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|
14
http.request(request)
15
end
16
​
17
puts JSON.parse(response.body)
Copied!
Copy link