Rest API for newsletter subscriptions

Paul Jackson asked on July 15, 2020 14:02

Is it possible to manage newsletter subscriptions via the REST api? I haven't seen the newsletter objects mentioned in any of the docs. We would want to add/remove subscriptions to various newsletters given an email address.

Thanks!

Recent Answers


Dmitry Bastron answered on July 15, 2020 18:35

Hi Paul,

I'm not sure it will be easy thing to do with the default REST API. Mainly because when we are talking about newsletter subscription for a given email address, it requires 3 objects to be created actually:

  • Contact (om.contact)
    • this may already exist for the given email, but if it is'n you need to create contact
    • check out OM_Contact database table
  • Subscriber (newsletter.subscriber)
    • subscribers can be Contacts (SubscriberType = om.contact) or Contact Groups (SubscriberType = om.contactgroup)
    • check out Newsletter_Subscriber database table
  • Newsletter subscriber (newsletter.subscribernewsletter)
    • this is a binding between newsletter and subscriber
    • check out Newsletter_SubscriberNewsletter database table

Though these objects are manageable via REST API individually it could be easier to implement your own custom API endpoint that will do this logic in just one call.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.