Hello everyone, just thought I’d share something I’ve recently seen with the Python API and that I couldn’t find posted anywhere online.
I have been trying to post a list of values with an associated timestamp to Ubidots every 10 seconds using: variable.send_values([{"value":val1, "timestamp":time1}, {"value":val2, "timestamp":time2}, etc...])
I found that the maximum number of values you can send is 200. My testing:
List sizes: 111, 193, 200 - Able to be sent.
List sizes: 202, 215, 219, 233, 317, 520 - ubidots.apiclient.UbidotsForbiddenError: Your token is invalid or you don't have permissions to access this resource
List size: 924 - requests.exceptions.ConnectionError: ('Connection aborted.', error(32, 'Broken pipe'))
If you know of a better way to send the data, I would be very appreciative if you could please let me know.
To handle the data with Python and Ubidots we highly recommend use requests. In the following guide you will find an example of the code. Take in count that he maximum size for the payload is the 10K bytes.