wouter173 / zermelo.py

zermelo api wrapper library for python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

code is not active

superniels09 opened this issue · comments

Exception has occurred: ValueError
Parsed code is not active.
File "C:\Users\niels\OneDrive\Python\Zermelo\test.py", line 6, in
token = cl.authenticate(code="here went my code")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Parsed code is not active.

Full script:
from zermelo import Client
import time

cl = Client(school="pantarijn")

token = cl.authenticate(code="here went my code")
print(token["access_token"])

user = cl.get_user(token["access_token"])
print(user)

def get(t1,t2):
unix_t1 = int(time.mktime(time.strptime(t1, "%Y-%m-%d %H:%M:%S")))
unix_t2 = int(time.mktime(time.strptime(t2, "%Y-%m-%d %H:%M:%S")))
appointments = cl.get_appointments(token["access_token"], unix_t1, unix_t2)
return appointments

print(get("2023-09-24 8:30:00","2023-09-24 15:15:00"))