Object type in HTTP request body parameter

Hi everyone!

So i am making a HTTP request and the API i am requesting to needs the input of the body parameter to be in the format of an “object” not a string, The data i want to input into the node is from a Google Sheets node earlier on in the workflow. I am not sure how to format an object in JSON as i am not too familiar with Javascript. Any help would be much appreciated!

Hey @aziadlourad,

You can add the value of the Key in the Name field and add an expression to refer to the data from the Google Sheets node in the Value field.

The other option is to toggle the JSON/RAW Parameters to true and add the JSON in the Body Parameters field.

You should be able to do something as follow in the Body Parameters field,

{
  key1: {{$node["Google Sheets"].json["column name1"]}},
  key2: {{$node["Google Sheets"].json["column name2"]}}
}

The above is a simple structure of JSON. This should hopefully work unless the API is expecting a different structure.

hi Harshil,

So for the first option it keeps saying “Body.attritbutes is required” where the attributes value is the one which needs to be in object form. I replaced the word “KEY” with the actual key I needed, and the appropriate value in the value box, but i still get this result.

For the second option I get a different problem which is " ERROR: The data in “Body Parameters” is no valid JSON. Set Body Content Type to “RAW/Custom” for XML or other types of payloads

I should also mention (Im not sure if this makes a difference) the request method I am doing is PATCH

Can you share the URL and the data you are sending via DM?

thanks for the awesome information.

my issue has been fixed.