Javascript (Jquery) Example

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

Find below an example of using jQuery.ajax to subscribe an email address.

// Set variables
base_url = "https://maitreapp.co/api/v1/list/subscribe";
payload = {
  api_token: "YOUR_API_TOKEN",
  uuid: "YOUR_LIST_UUID",
  hosting_url: "YOUR_HOSTING_URL",
  email: "support@maitreapp.co"
};

// POST the request
$.ajax({
  url: base_url,
  type: "POST",
  data: payload,
  success: function(data) {
    if (data.status == "ok") {
      // Email successful subscribed
    } else {
      // Handle error
    }
  }
});

Still need help? Contact Us Contact Us