I’ve just started exploring how I could use the FrameIO Python API, and I can’t get either the fioctl or Python api to work. I’m thinking my tokens aren’t working.
When i try to run fioctl through windows cmd after I’ve ran the configue command and created a profile and inputed my token:
fioctl projects list jnortheastfilms
Traceback (most recent call last):
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\Scripts\fioctl.exe\__main__.py", line 7, in <module>
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\fioctl\projects.py", line 40, in list
format(projects, cols=columns)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\fioctl\utils.py", line 118, in format_table
value = list(value)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\fioctl\fio.py", line 19, in stream_endpoint
for result in client_utils.stream(fetch_page, page=page, page_size=page_size):
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\frameioclient\utils.py", line 14, in stream
result_list = func(page=page, page_size=page_size)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\fioctl\fio.py", line 17, in fetch_page
return client._api_call('get', furl(endpoint).add({'page': page, 'page_size': page_size}).url)
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\frameioclient\client.py", line 46, in _api_call
return r.raise_for_status()
File "C:\Users\jnort\AppData\Local\Programs\Python\Python310\lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://api.frame.io:443/v2/teams/jnortheastfilms/projects?page=1&page_size=15
I have a similar issue when I try to run a simple command in python
import requests
url = "https://api.frame.io/v2/me"
headers = {
"Authorization": "Bearer <###My_TOKEN###>"
}
print(requests.get(url,headers=headers))
results in:
<Response [401]>
Any idea why my tokens aren’t working? I’ve got a Pro FrameIO account.
Cheers,
Josh