How to call default API endpoint in custom plugin?

Thanks for your response. This has solved my issue, but I can’t seem to call the endpoint without adding auth: false to the config. Otherwise I get a 401.

I don’t want to disable the authentication. How do I include authentication to the request?