This might not be the correct use for the jupyter REST api, but I am trying to modify a notebook on jupyterlab from an extension. I am making the patch /api/contents/path_to_file.ipynb?token=123.
My issue is that I do not know how to get the authentication token programmatically. Is there a way to get the token from typescript in my extension?
Note that using the ServerConnection.makeRequest can do a better job of consistently applying headers, etc. than manually constructing fetch arguments, etc.