Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
 neena123
		
			neena123
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Hello!
I am very new to APIs and using REST to connect to retrieve my data. I am absolutely lost on the process of setting up a connection. I have downloaded the Rest connector and I do know that in order to retrieve my data it requires a 2 step Oauth approach. What I have is the grant type, client id and client secret information as well as the URL to get my access token. But how do I start this? Any guidance is appreciated!
 asinha1991
		
			asinha1991
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You will have to get full documentation of the REST request(with request examples) from the team that maintain REST server or API support
there must be 2 url one to fetch access token(you pass client id and client secret as query parameter) and other to get data.
access token has to be passed in second url as query parameter or header( you will see these options when you try to create a connection)
In QlikView, I don't think you can pass parameters dynamically (as it might not support with clause). I use qliksense which supports dynamic passing. It depends on how long your access token remains valid. You can fetch it manually everytime using clients like chrome advanced rest connection and put it manually in your rest call to fetch data if it is valid for considerable time like a week or a month etc. You can also use some other programming language to fetch and store data somewhere if you are a developer.
An example( qliksense but should help you understand)
//To fetch token, FetchConnection is the name of REST connection with url of fetching token . You can generate query using create query wizard
LIB CONNECT TO 'FetchConnection';
response:
SQL SELECT
"token_type",
"access_token"
FROM JSON (wrap on) "root";
let access_token = peek('access_token', -1);
let token_type = peek('token_type', -1);
trace $(access_token);
//this is call to fetch data url but instead of creating connection, i am passing dynamic values using with which may not work in qlikview
RestConnectorMasterTable:
SQL SELECT
xyz
FROM CSV (header on, delimiter ",", quote """") "CSV_source"
WITH CONNECTION (
Url "urltofetchdata",
HTTPHEADER "Accept" "application/json;odata=verbose",
HTTPHEADER "Authorization" "$(token_type) $(access_token)")
;
I will have data in RestConnectorMasterTable:
This video will help you understand how to create connection and create query using rest connector
.png) Brett_Bleess
		
			Brett_Bleess
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Neena, just ensuring you also did read through the Help on the REST Connector, it is pretty robust. Here is a link to the section I think you need in this case, but I will paste the top level link below that as well, so you can see everything.
Regards,
Brett
 cavetroll
		
			cavetroll
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		 asinha1991
		
			asinha1991
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		You will have to get full documentation of the REST request(with request examples) from the team that maintain REST server or API support
there must be 2 url one to fetch access token(you pass client id and client secret as query parameter) and other to get data.
access token has to be passed in second url as query parameter or header( you will see these options when you try to create a connection)
In QlikView, I don't think you can pass parameters dynamically (as it might not support with clause). I use qliksense which supports dynamic passing. It depends on how long your access token remains valid. You can fetch it manually everytime using clients like chrome advanced rest connection and put it manually in your rest call to fetch data if it is valid for considerable time like a week or a month etc. You can also use some other programming language to fetch and store data somewhere if you are a developer.
An example( qliksense but should help you understand)
//To fetch token, FetchConnection is the name of REST connection with url of fetching token . You can generate query using create query wizard
LIB CONNECT TO 'FetchConnection';
response:
SQL SELECT
"token_type",
"access_token"
FROM JSON (wrap on) "root";
let access_token = peek('access_token', -1);
let token_type = peek('token_type', -1);
trace $(access_token);
//this is call to fetch data url but instead of creating connection, i am passing dynamic values using with which may not work in qlikview
RestConnectorMasterTable:
SQL SELECT
xyz
FROM CSV (header on, delimiter ",", quote """") "CSV_source"
WITH CONNECTION (
Url "urltofetchdata",
HTTPHEADER "Accept" "application/json;odata=verbose",
HTTPHEADER "Authorization" "$(token_type) $(access_token)")
;
I will have data in RestConnectorMasterTable:
This video will help you understand how to create connection and create query using rest connector
 neena123
		
			neena123
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Thanks for your help. I did download postman and got my access token. But now where do I "copy and paste" in Qlikview? I am sure there is some type of script I would need to write. Since it is a 2 step process I will need to be able to automate my Access Token so that I don't need to manually do it ever time I want the data to refresh right?
 asinha1991
		
			asinha1991
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		yes, you should automate it but I doubt it can be done in QlikView...in Qliksense they provide a way to pass dyanamic value.
For QlikView you need to add it as query header in your create connection (you can see that in the video)
.png) Brett_Bleess
		
			Brett_Bleess
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		Neena, just ensuring you also did read through the Help on the REST Connector, it is pretty robust. Here is a link to the section I think you need in this case, but I will paste the top level link below that as well, so you can see everything.
Regards,
Brett
 shalini
		
			shalini
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		HI,
I have a scenario where i need to access the auth token to authenticate an external application integrated with qlik app. are you aware of an API to access the token from my external app backend server so that i can authenticate my app with the same credentials without having to provide a separate login page which breaks the user experience.
 Ken_T
		
			Ken_T
		
		
		
		
		
		
		
		
	
			
		
		
			
					
		did anyone ever figure this out, or no?
