From 193b70c0d288faf182fb2ecd788436cc2f453a71 Mon Sep 17 00:00:00 2001 From: Ross Kelso Date: Mon, 25 Sep 2023 15:23:29 +0100 Subject: [PATCH] Updated example to use new API url and call new example query --- config-example.json | 2 +- example/implicit_grant_flow.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/config-example.json b/config-example.json index a33ff18..519597c 100644 --- a/config-example.json +++ b/config-example.json @@ -7,6 +7,6 @@ "base_url": "https://appstore.intelligentplant.com" }, "data_core": { - "base_url": "https://appstore.intelligentplant.com/gestalt" + "base_url": "https://api.intelligentplant.com/datacore" } } \ No newline at end of file diff --git a/example/implicit_grant_flow.py b/example/implicit_grant_flow.py index 3afc309..91dec5a 100644 --- a/example/implicit_grant_flow.py +++ b/example/implicit_grant_flow.py @@ -66,7 +66,10 @@ def test_client(token): print(times) #writes a value at the current time - writeResults = example_queries.write_snapshot(data_core); + write_snapshot_result = example_queries.write_snapshot(data_core) + + #writes a value at a time in the past + write_historical_result = example_queries.write_historical(data_core) def on_loaded(window): @@ -78,9 +81,11 @@ def on_loaded(window): window.destroy() #get the access code from the current url parsed = urllib.parse.urlparse(url) - print(parsed) + + access_token = urllib.parse.parse_qs(parsed.fragment)['access_token'][0] + print(access_token) #test the app store and data core clients - test_client(urllib.parse.parse_qs(parsed.fragment)['access_token'][0]) + test_client(access_token) break #load the json config file with the app information