API limits?

Hey guys. I am currently using the API to get the device tags and device environment variables. I am using it in python the urls are:$filter=device/uuid eq ‘{}’$filter=device eq {}

What I experience is that I often get rejected requests or I would rather say “invalid” ones. So basically, I will show you an example how I work with one of the links above.

get_all_environment_variables_device_url = '$filter=device eq {}'

environment_variables = []
		response = requests.get(
				headers={"content-type":"application/json","Authorization":"Bearer {}".format(auth_token)}
		if response.content == 'Unauthorized':
			print('Invalid token provided. Unauthorized')
		environment_variables = json.loads(response.content)['d']
	except Exception as e:
		exc_type, exc_obj, exc_tb = sys.exc_info()
		fname = os.path.split(exc_tb.tb_frame.f_code.co_filename)[1]
		print('%Y-%m-%d %H:%M:%S') + ' Type:{} Filename:{} Line:{} ERROR: {}'.format(exc_type, fname, exc_tb.tb_lineno,e))

So, basically, sometimes I get an error response from your side and it cannot load the environment variables. It’s happening exactly the same on the tags endpoint as well. Do you have any limits on the API and if you have how much are they? I am getting it quite often and it bothers me a bit. I can provide some additional info like status code and response content if you want.


Any additional information (status codes and response content) would definitely help.

Also, please make sure that you are using named API keys ( instead of session tokens ( when you are interacting with the API, because the latter expire and could be the reason behind the authentication errors you are experiencing.