At my work, we use a crm whose REST api is far from ideal.
Basically, to add a contact from the frontend of the site, you need to check for someone first, then go from there with 2-4 more if/thens.
You also need to always remember to lowercase the email before pushing it in.
This isn’t the most fun.
So, I setup one endpoint that either creates or updates a contact. Then, adds a tag and/or associates whatever other info I pass in.
It’s pretty handy to have Lambda’s around to solve issues like this.
Before serverless, I’d have put this code on a random monolith we had lying around. Or, maybe not have thought to do it at all.
Now, we can update our CRM from one easier to use REST api wrapper.
The first place I used it was in a Lambda catching Stripe webhooks.
If that webhook is of a certain type, it sends post request to this new CRM lambda I wrote to add a tag to the customer.