Ruby Example

ⓘ This example is purely and solely for example purposes and is by no means production ready. If you have written a library based on our API please ke ep in touch.

Find below an example of using Ruby to subscribe an email address.

require 'net/http'
require 'uri'

# Set variables
base_url = "{uuid}/subscribers"
payload = {
 api_token: "YOUR_API_TOKEN",
 hosting_url: "YOUR_HOSTING_URL",
 email: ""

# Send the request
response = Net::HTTP.post_form(URI(base_url), payload)

# Access data and create your logic
if response["status"] == "ok"
 # Email successful subscribed
 # Error

Still need help? Contact Us Contact Us