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').
Moreover how 'preload_likes' ($preload = elgg_extract('preload_likes', $vars);) is set in the DataService.
This is an optional parameter that you can use for caching.
Here're similar cases.
Thanks.
Where can I see the details of the service (It's just a service that counts the number of annotations on create, annotation and delete, annotation events.)
You've already asked about this.
I think Jerome and I have made it clear to you that this won't work.
If you've a project on Elgg that you want to transfer, use this tutorial.
If you've something else, you need to use Elgg API.
For the latter case, you'll need some custom plugin or a one-time script.
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.