I need create a issue in Enonic inside a Task. To make this, I thought of call the Enonic API service to create an issue. The path to the service is: http://localhost:8080/admin/rest/issue/create
My doubt is if this is possible, because this code not work (return code 403).
I don’t think this should work - you cannot expect to get authorised by just sending a password in a header with API request.
request method of the Http client lib has auth parameter which is specifically designed to be used for basic authentication. Please read the docs here.
Also, even though the docs state that body can be either string or an object, it didn’t work when I used plain object - I had to stringify it. We’ll check why this happens.
The admin REST API is not documented and intended for use by 3rd party apps. If you need to create issues, use the Java API or a library if there is one.