Hi,
I am trying to run some GET API requests. but it gave me errors `IOError: Server returned HTTP response code: 401 for URL: https://api2.kaiza.la//v1/accessToken which related to authentication.
The original code run well in POSTMAN tools but when I converted the code to be matched with ignition it’s not working
PostMan code:
import requests
url = "https://api2.kaiza.la//v1/accessToken"
payload = {}
headers = {
'applicationId': 'f8cd93db-8e94-4c4@2',
'applicationSecret': '7T3OY',
'refreshToken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ld5SH_Xgyq2C4fyKgGLKcal7RYzgY20VG6Y3t2mIZtU'
}
response = requests.request("GET", url, headers=headers, data = payload)
print(response.text.encode('utf8'))
My Code in ignition
import system
url = "https://api2.kaiza.la//v1/accessToken"
payload = {}
headers = {
'applicationId': 'f8cd93db-8e94-4c4@2',
'applicationSecret': '7T3OY',
'refreshToken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ld5SH_Xgyq2C4fyKgGLKcal7RYzgY20VG6Y3t2mIZtU'
}
response = system.net.httpGet(url,headers=headers, data = payload)
print response
print(response.text.encode('utf8'))