Request details
I have a table with check boxes live on the web. Each check box is a different company. The table lives in an iframe. It is hosted by Netlify which is only for static sites and thus my table must live in an iframe. It looks like: [login to view URL]
Note: Assume in the table that there are a few dozen companies and up to five can be checked at once. Every company listed in the check boxes is also a pre-existing Group (or tag in mailChimp language) in MailerLite.
Below the table is a form, also in an iframe. It looks like: [login to view URL]
When the form is submitted, I want the email and radio button selection of the user to be added as a new subscriber to MailerLite. (Easy and already working).
I also require this new user in MailerLite to be assigned to every pre-existing Group that was checked off in the table. (Trickier) This is where I need help.
The MailerLite reference (cURL mainly) has a section on webhooks:
[login to view URL]
Hurdle 1: The MailerLite reference is quite terse
Hurdle 2: The table is written in R in a Shiny app by me.
I I understand the problem correctly, I need help creating the webhook in MailerLite. I can create a webhook using cURL but I don't understand how to pass a payload of information (ie the new subscriber ID) along to an endpoint(?) script that is listening for a new subscriber (the event trigger). Given a new subscriber ID, I can add them to pre-existing MailerLite Groups using cURL or R.
Deliverables
What Success Looks Like
When a user enters their email in the form, a new user is added to my MailerLite account with this form information. At the same time, this new user is assigned the companies as MailerLite Groups that were selected in the table on the same page (but in an iframe).
I understand it may not be possible to do everything in R.
Hello,
I m a web and desktop developer with 10 years of experience in C# ,I did many management web system during my professional life,
I can do what you want in the deadline just contact me and we can discuss more about the project.
Best Regards
Fouad
Hello,
I'm probably giving the answer away here but you're not too far off course. All you need to do is correctly format the data as a JSON payload (so you'll need to get the form data and reformat it a bit to match the schema in the example) and then do a POST (plenty curl examples for that) and, don't forget, in the header to include the API Key otherwise it won't play nicely.
Totally convinced you can do this task without my help but if my 26 years of experience in APIs can guide you feel free to shoot through some questions and I will do my best to help.
Warmest Regards,
Stephen Lombard