Calling webaction from Postman returns 204 instead of printing response message | Community
Skip to main content
sarav_prakash
Community Advisor
Community Advisor
September 23, 2024
Solved

Calling webaction from Postman returns 204 instead of printing response message

  • September 23, 2024
  • 1 reply
  • 552 views

I wrote a simple webaction and deployed to my workspace

 

import { setGlobals } from "./common.mjs"; function main(params) { setGlobals(params); return { result: "Trigger runtime action successfully" }; } const _main = main; export { _main as main };

 

When I call the action from Postman, I only receive a 204 and NO response message 

But I know web-action is invoked, coz when I add log statements, they are logged successfully. What am I missing? Why is the result message not returned when invoked from Postman?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by sarav_prakash

The return object was missing statusCode. Changing the response like this fixed this

import { setGlobals } from "./common.mjs"; function main(params) { setGlobals(params); return { headers: { "Content-Type": "application/json" }, statusCode: 200, body: { result: "Item ingest action triggered successfully" }, }; } const _main = main; export { _main as main };

 

1 reply

sarav_prakash
Community Advisor
sarav_prakashCommunity AdvisorAuthorAccepted solution
Community Advisor
October 12, 2024

The return object was missing statusCode. Changing the response like this fixed this

import { setGlobals } from "./common.mjs"; function main(params) { setGlobals(params); return { headers: { "Content-Type": "application/json" }, statusCode: 200, body: { result: "Item ingest action triggered successfully" }, }; } const _main = main; export { _main as main };