Qlik Community

Qlik Sense Data Connectivity

Discussion board where members can learn more about Qlik Sense Data Connectivity.

Announcements
Announcing the newest addition to the Qlik Community, Qlik Gallery! Learn More
berryandcherry6
Contributor II

Remote Server returned an error:(404)Not found while connecting Rest Connector in Qliksense 3.0

Hi,

I  need to fetch Google Analytics data in Qliksense 3.0. For this

1.)i have got client_id, Client_secret & Refresh_token from https://developers.google.com/oauthplayground.

2.)And copy pasted below code from this link REST CONNECTOR locate the Authorization token .  and Started to create connection "Google Authorization".

For second point to work, i need to create connection "Google Authorization". I am stuck here, if i create connection by Create new connection --> Qlik Rest Connector -->  URL = https://www.googleapis.com/oauth2/v4/token. It shows Remote Server returned an error:(404)Not found.

SET vClient_id = 'entered client_id'; 

SET vClient_secret = 'entered Client_secret'; 

SET vRefresh_token = 'entered Refresh_token'; 

IF vTokenExpires <= now() THEN // if access_token expired request a new one using the refresh_token 

 

  LET vRequestBody =''; 

  LET vRequestBodyvRequestBody = vRequestBody & 'grant_type=refresh_token'; 

  LET vRequestBodyvRequestBody = vRequestBody & '&client_id=' & '$(vClient_id)'; 

  LET vRequestBodyvRequestBody = vRequestBody & '&client_secret=' & '$(vClient_secret)'; 

  LET vRequestBodyvRequestBody = vRequestBody & '&refresh_token=' & '$(vRefresh_token)'; 

 

   LIB CONNECT TO 'Google Authorization'; 

 

  access_token: 

  SQL SELECT 

  "access_token", 

  "token_type", 

  "expires_in" 

  FROM JSON (wrap on) "root" 

    WITH CONNECTION ( 

    URL "https://www.googleapis.com/oauth2/v4/token", 

    HTTPHEADER "Content-Type" "application/x-www-form-urlencoded", 

  BODY "$(vRequestBody)" 

  ); 

  LET vExpiresIn = peek('expires_in',0,'access_token'); 

  LET vAccessToken = peek('access_token',0,'access_token'); 

  LET vTokenExpires = timestamp(now() + $(vExpiresIn)/86400); 

ENDIF 

How should i create connection for "Google Authorization" and proceed further. PLease help on this.

Regards.