Authenticating to Looker API in Apex

I am trying to access a Look via the API from within our Salesforce Org. I am able to reach Looker and get an Access Token, I am then setting it in a header like so

req.setMethod('GET');
req.setEndpoint(loginUri + '/looks/' + lookID + '/run/json?limit=5000');
req.setHeader('access_token', token);
req.setHeader('token_type', 'Bearer');
req.setCompressed(true);

I know that I am capturing the token correctly and I know it is being passed in as the header correctly. However I only return this:

   16:02:24:141 USER_DEBUG [28]|DEBUG|{"message":"Requires 
   authentication.","documentation_url":"http://docs.looker.com/"}

This is kind of driving me nuts as I know I am just missing some small thing but I canā€™t for the life of me figure out how I am messing up the authentication here.

Hi Travis,
I believe the token setup in header is not correct.

I believe it will be like this.
String authHeader = 'Bearer ā€™ + accessToken;
req.setHeader(ā€˜Authorizationā€™, authHeader);

1 Like