Using cURL in assembly editor

The API documentation I am trying to connect with is all in cURL requests.
Is there any module in the assembly builder that just allows me to paste the cURL request? (not finding anything in the forums or help docs… I could’ve missed it though)

Once your connect your prior elements to any downstream element, all it says is [wired]. I don’t know if it is merging in the value I need correctly.

ie - if a POST url should have https://www.google. com/?q=[some variable here]&utm_campaign =foo&utm_media=bar

There is no way to know if the predefined variable value is merged into the right place effectively

Hi Mike,

There is not currently a module that accepts raw curl commands.

The most common technique for making API calls is to use a URL Builder module to build the URL and either an HTTP Transaction or OAuth Transaction module to invoke the API request.

You can wire in parameters into the URL as follows:

Then double-click modules in the editor to execute the diagram to that point. You can then inspect the output of the module by either looking at the lower left output window or by clicking the magnifying glass icon in the module’s title bar:

The assembly editor is a live editor. As you double-click modules the diagram executes to that point and you can review results to know if what you are building is working as expected.

Robert

@robert super helpful!

A new problem I am seeing now is that the HTTP Post module doesn’t let you effectively build out variables in JSON…

I am tyring to get the following Key Value pair to show up but it isn’t formatting in JSON as it needs to

Key: consumer_id
Value: name-of-consumer

I keep getting errors that ‘c’ is invalid
when I add “” around the pairs I get that “%” is invalid
when I look at the output, it is apparent that the tool is building a cURL request, however the -d section isn’t formatting in JSON.

Any tips / workarounds?

leaving this in the thread as this is a by product / symptom of not being able to paste in a cURL and have the system parse and send appropriately

To post a json payload, use the JSON Builder module: Assembly Editor

The module will escape mapped values as needed and ensure that well-formed json is emitted.

1 Like

So I do 1 for the key, and 1 for the value and then map them into the post?

Is that how it works?

Send me the link to the documentation for the api call you want to make.

It sounds like you are using a Multipart POST module, which typically is not the needed module.

Here is a loom of what I am doing

Remove the POST Body parameter for “consumer_id”. Wire the output from the JSON Builder to the Text Payload here:

This will send the json payload to the endpoint, which is typically what you want to do for most api’s.

Post body parameters are rarely used.

Is worthwhile to review other existing assemblies in the system to see common patterns. I never start with an empty diagram…

1 Like