First, you need to get auth_token using auth.gettoken method and pass it to your service to perform the task.
That's, your service should accept the token and return it to Elgg with a new task.
Perhaps more details about what you're doing will help clarify the situation better.
There is no need to add auth_token because I set the following two parameters to false
'require_api_auth' => false,
'require_user_auth' => false,"I would like to test the service by sending a JSON payload via a POST request using Postman."
Sending the requests to Elgg you should not send JSON.
In Postman set the POST body to x-www-form-urlencoded and the params as the api call requires.
In response you'll get a JSON, but you can't do that in the request.
In Elgg 6.x we switched from RequireJS to the native ESM modules for Javascript.
https://learn.elgg.org/en/stable/appendix/upgrade-notes/5.x-to-6.0.html#es-modules
Is there a need to extend the 'global' JS or could you rewrite your code to make use of the ESM modules. (If your JS is only needed on a few pages it's better to use an ESM module).
If your your needs to be present on all pages and you can't use an ESM module you can extend the 'elgg.mjs' view (instead of 'elgg.js').
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.