Automation Studio Quandary

I’m 99% complete with a recipe and it seems like I’m going to have to get creative to get the last 1% so I’m bringing my problem to this group of creative thinkers.

I’m using the http connector to call an API that doesn’t have a dedicated connector in Workato. The API requires the request body to be an unnamed array
image

The Workato http connector won’t let me do an unnamed array, so I end up with a body that the API can’t process
image

The simplest solution seems to be a custom http connector using the connector SDK – but that’s not available to customers in Automation Studio and so far Epicor professional services has declined a request to create one.

There is an option to set the http connector request type to Raw JSON request body.
image

I’ve tested pasting a properly structured request into the request body and it worked as expected.

If I could get Workato to create the request body and then put it into a string variable, I could use a formula to remove the array name from the string. Then I could send the string the request body. I haven’t figured out a way to make that happen yet.

Any suggestions?

Can you not build the request body in a variable and then drop that variable datapill into the request body field of that step? I haven’t really tried the http connector for anything yet.

Might be possible…it’s a fairly complex request body with nested arrays. Thinking about this approach kind of makes my head hurt.
Sleepy Good Night GIF by Nat Geo Wild

You could possibly use a common data model in a structure that AS will accept. This can be found under tools.

Then in your recipe use the mapper to map to this model.

Then you can use a formula in your http call to take this array and convert to json.

I really like this idea! I was already using a common data model. Shouldn’t take long to give this a try.
Happy Chris Pratt GIF by Parks and Recreation