Python Forum
API call returning list value of 'None'
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
API call returning list value of 'None'
#3
@buran, thanks. hopefully this helps. I put a * for some of the items.

import time
import samsara
from samsara.rest import ApiException
from pprint import pprint
import time, datetime
#
group_id = *
#Date and time (your time zone): Tuesday, June 11, 2019 1:00:00 PM GMT-04:00
start_ms = 1560333600000
#Date and time (your time zone): Tuesday, June 11, 2019 6:00:00 PM GMT-04:00
end_ms = 1560344400000
#3600000 will return data at hour intervals
step_ms = 3600000
series = [{"field":"probeTemperature","widget_id":212014918280113}]
#
api_instance = samsara.DefaultApi()
access_token = '#' # str | Samsara API access token.
history_param = samsara.HistoryParam(group_id, start_ms, end_ms, step_ms, series) # HistoryParam | Group ID, time range and resolution, and list of sensor ID, field pairs to query.
#print(history_param)

try: 
    # /sensors/history
    api_response = api_instance.get_sensors_history(access_token, history_param)
    pprint(api_response)
Reply


Messages In This Thread
RE: API call returning list value of 'None' - by jimbone30 - Jun-14-2019, 12:53 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  list.sort() returning None SmallCoder14 8 671 Mar-19-2024, 09:49 PM
Last Post: SmallCoder14
  for loops break when I call the list I'm looping through Radical 4 952 Sep-18-2023, 07:52 AM
Last Post: buran
  How do I call sys.argv list inside a function, from the CLI? billykid999 3 830 May-02-2023, 08:40 AM
Last Post: Gribouillis
  returning a List of Lists nafshar 3 1,132 Oct-28-2022, 06:28 PM
Last Post: deanhystad
  How to create a linked list and call it? loves 12 4,666 Nov-22-2020, 03:50 PM
Last Post: loves
  list call problem in generator function using iteration and recursive calls postta 1 1,963 Oct-24-2020, 09:33 PM
Last Post: bowlofred
  2d List not returning DariusKsm 2 1,735 Sep-22-2020, 05:11 PM
Last Post: DariusKsm
  How to call/read function for all elements in my list in python johnny_sav1992 1 2,120 Jul-27-2020, 04:19 PM
Last Post: buran
  Need help returning min() value of list? edwdas 3 2,121 Nov-10-2019, 09:43 PM
Last Post: snippsat
  Call and execute methods from a list asheru93 2 2,364 Jan-17-2019, 08:31 AM
Last Post: asheru93

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020