Skip to content

Instantly share code, notes, and snippets.

@nishitpatel01
Created August 24, 2022 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nishitpatel01/878193e5e73a2d1de8b6ce35111b0542 to your computer and use it in GitHub Desktop.
Save nishitpatel01/878193e5e73a2d1de8b6ce35111b0542 to your computer and use it in GitHub Desktop.
new_event_payload = {
{
"events": [
{
"groupId":"1324354349507023708",
"dimensions":[
{"name":"measure","stringVal":"LTTH"},
{"name":"Humidity","doubleVal":36},
{"name":"Light","doubleVal":99},
{"name":"h2_raw","doubleVal":1041},
{"name":"temp","doubleVal":36.97}
],
"eventTime":"2022-02-16T15:45:00+00:00"
}
]
}
}
# append event call
query_ds_endpt = f'https://timeseriesinsights.googleapis.com/v1/projects/{PROJECT_ID}/datasets/{dataset}:appendEvents'
res = query_ts(method="POST", endpoint=query_ds_endpt, data=new_event_payload, auth_token=token_array[0])
res
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment