Each. request for a resource has a similar pattern. Request the HTML, load and execute the javascript that in turn make an authenticated request for the JSON (assume for now you are authenticated)
GET / (text/html)
GET api.js (text/javascript)
GET / (application/json;q=1.0 & XMLHttpRequest) (with Authorization header)
The api client uses (Axios) to make HTTP requests the hood. In the example above, the highlighted lines are the headers that must be set by the client to request JSON over HTML.