invokeUrl - send body with GET request

invokeUrl - send body with GET request

Hello,

I am trying to utilize the invokeUrl Deluge function to send a GET request with JSON request details in the body to my Node.js (Express) API. Request information is sent in the body because the request data can exceed URL parameter length and because the endpoint can accept a JSON array and loop through each object in the array. 

The invokeURL task documentation states that adding the "parameters" field to my invokeurl task will fill the body of my request. However, on the documentation, there are only examples of adding the parameters to a POST request. When using the methodology in my code snippet below, I can verify that the endpoint is successfully being reached but the body of the request is empty when viewing the request logs of the Node.js application.

From a NodeJS Express perspective, there is a difference between the "body" of a request and the "parameters" associated with a request:
req.params
"This property is an object containing properties mapped to the named route “parameters”. For example, if you have the route /user/:name, then the “name” property is available as req.params.name. This object defaults to {}."

req.body
"Contains key-value pairs of data submitted in the request body. By default, it is undefined, and is populated when you use body-parsing middleware such as body-parser and multer."

I am taking advantage of the "body-parser" middleware in the application. 


Because the invokeUrl makes use of the "parameters" parameter, I am unsure if req.body is actually being set. The Node.js service is logging the result of every incoming "req.body", but because it is running in production I can't make changes to test the logging of "req.params".

When replicating the request from Postman (content-type is application/json, the request is a GET request, and the request body is filled with identical JSON ), the body is successfully written. 

A snippet of my request is attached below for reference:

request_headers = Map();
request_headers.put("Authorization","<Authorization info>");
request_body = {
      "company":"test",
      "sku":"test",
      "quantity":"test",
      "customerNumber":"0001",
      "currencyCode": "USD"
};
response = invokeurl
[
url :"https://my-api-url.com/endpoint"
type :GET
parameters:request_body.toString()
headers:request_headers
content-type:"application/json"
];
info response;
 

For additional context, I can also reach the API endpoint using:
curl --location --request GET 'https://my-api-url.com/endpoint' \
--header 'Authorization: <Authorization info>' \
--header 'Content-Type: application/json' \
--data-raw '[
    {
        "company""201",
        "sku""0216011050",
        "quantity""10",
        "customerNumber""0",
        "currencyCode"""
    },
    { 
        "company""201",
        "sku""116005500",
        "quantity""10000",
        "customerNumber""113805",
        "currencyCode"""
    }
]'
Any help understanding why the request's body is empty would be greatly appreciated!
    • Sticky Posts

    • Kaizen #217 - Actions APIs : Tasks

      Welcome to another week of Kaizen! In last week's post we discussed Email Notifications APIs which act as the link between your Workflow automations and you. We have discussed how Zylker Cloud Services uses Email Notifications API in their custom dashboard.
    • Kaizen #216 - Actions APIs : Email Notifications

      Welcome to another week of Kaizen! For the last three weeks, we have been discussing Zylker's workflows. We successfully updated a dormant workflow, built a new one from the ground up and more. But our work is not finished—these automated processes are
    • Kaizen #152 - Client Script Support for the new Canvas Record Forms

      Hello everyone! Have you ever wanted to trigger actions on click of a canvas button, icon, or text mandatory forms in Create/Edit and Clone Pages? Have you ever wanted to control how elements behave on the new Canvas Record Forms? This can be achieved
    • Kaizen #142: How to Navigate to Another Page in Zoho CRM using Client Script

      Hello everyone! Welcome back to another exciting Kaizen post. In this post, let us see how you can you navigate to different Pages using Client Script. In this Kaizen post, Need to Navigate to different Pages Client Script ZDKs related to navigation A.
    • Kaizen #210 - Answering your Questions | Event Management System using ZDK CLI

      Hello Everyone, Welcome back to yet another post in the Kaizen Series! As you already may know, for the Kaizen #200 milestone, we asked for your feedback and many of you suggested topics for us to discuss. We have been writing on these topics over the