脚本
from seatable_api import Base, context
SERVER_URL = 'https://xmseatable.mytest.com/'
API_TOKEN = '88a84c8ed7194e1721daee1b4a526d2e94f5c573'
ACTIVE_ROW = context.current_row
USER = context.current_username
def get_authorized(server_url = SERVER_URL, api_token = API_TOKEN):
base = Base(api_token, server_url)
return base
def main():
base = get_authorized()
base.send_toast_notification(USER, '测试成功', toast_type='success')
if __name__=="__main__":
main()
报错:
error: Error: line 20, in main() File “/scripts/index.py”, line 17, in main base.send_toast_notification(USER, ‘测试成功’, toast_type=‘success’)
File “/home/seatable/.local/lib/python3.11/site-packages/seatable_api/main.py”, line 25, in wrapper raise BaseUnauthError seatable_api.exception.BaseUnauthError: The base has not been authorized