My first tests with Bardeen’s HTTP GET and POST components left me struggling to be productive despite years of experience building API integrations. Bardeen, after all, is about achieving high productivity.
What seems to be missing when using the HTTP POST component is a simple way to serialize JSON objects the likes of which are typically required when you publish content to other systems.
This became painfully obvious when I created the Bardeen-to-Mem example. Like many APIs, the Mem API requires a simple JSON payload that looks like this:
{
"Content" : "The content...",
"createdAt" : "1994-11-05T08:15:30-05:00"
}
Crafting one of these in a Merge Text component seems simple enough until you actually build one. If you want to create a json payload and infuse some markdown to expose links more favorably or some date formatting, it’s even worse.
Bardeen needs a serializer component with templated text composition that allows you to blend other component outputs arbitrarily much the way a mail merge system uses handlebar variables.
The red arrows identify some of the really tricky points in the way the payload must be crafted.
Serializer Service
To [partially] overcome this challenge, I created a simple Google Apps Script Service. Here’s
, however, I make no guarantees that it will be alive for the long run.
Instead of the madness shown above, I can sidestep much of the complexity by simply making an HTTP GET to serialize the data before sending it on to the API. Here’s a
If there’s a way to simplify this even more, don’t hesitate to do so and share how you did it. Hopefully, this post will be made obsolete by the folks at Bardeen.