<reponame>alisqualityintelligence/alis-api-examples<filename>python-requests/getResults.py
#!/usr/bin/env python3

import requests

def getResults():
	authToken	= '2<PASSWORD>'
	setId		= 145

	# We may put the authentication token in the query string, though that's not recommended
	#response = requests.get(
	#	'https://example.alisqi.com/api/getResults?access_token={authToken}&setId={setId}&filter=%7B%22status_%22%3A%5B%7B%22value%22%3A3%7D%5D%7D'.format(
	#		authToken = authToken, setId = setId
	#	)
	#)
	#print(response.json())
	
	# The recommended method is to use the Authorization header
	# This applies to every API operation
	requests.get(
		'http://localhost:8008/alis/api/getResults?setId={setId}'.format(setId=setId),
		headers={'Authorization': 'Bearer ' + authToken}
	)

if __name__ == '__main__':
	getResults()

#!/usr/bin/env python3

import requests

def getResults():
	authToken	= '2<PASSWORD>'
	setId		= 145

	# We may put the authentication token in the query string, though that's not recommended
	#response = requests.get(
	#	'https://example.alisqi.com/api/getResults?access_token={authToken}&setId={setId}&filter=%7B%22status_%22%3A%5B%7B%22value%22%3A3%7D%5D%7D'.format(
	#		authToken = authToken, setId = setId
	#	)
	#)
	#print(response.json())
	
	# The recommended method is to use the Authorization header
	# This applies to every API operation
	requests.get(
		'http://localhost:8008/alis/api/getResults?setId={setId}'.format(setId=setId),
		headers={'Authorization': 'Bearer ' + authToken}
	)

if __name__ == '__main__':
	getResults()
#!/usr/bin/env python3 # We may put the authentication token in the query string, though that's not recommended #response = requests.get( #	'https://example.alisqi.com/api/getResults?access_token={authToken}&setId={setId}&filter=%7B%22status_%22%3A%5B%7B%22value%22%3A3%7D%5D%7D'.format( #		authToken = authToken, setId = setId #	) #) #print(response.json()) # The recommended method is to use the Authorization header # This applies to every API operation