Finding the workspace ID associated to a given session through the API

Hello,

I need, for book keeping purposes, to log the workspace ID associated with the live session created through a python script.

For example, I create a live session with the following:

### CREATING LIVE SESSION ###

project_uid = ProjID
session_title = SeshTit
session_description = Desc
user_id = cs.cli.get_id_by_email(UserEmail)

session_uid = cs.rtp.create_new_live_workspace(project_uid=project_uid, created_by_user_id=user_id, title=session_title, desc=session_description)

cs was define as a CryoSPARC() instance previously.

If I print the session_uid, I get a string S3 for example which is good for identifying the session. However, I cannot find a way to pull the workspace ID of the workspace created along with the session I just created.

Thank you for the help,

Best,

Hi:

Whereas the behavior or availability of CryoSPARC rtp or cli commands is subject to change in future versions of CryoSPARC, in recent versions, like v4.7, one may find out the workspace UID associated with the session using the command (based on definitions in your code sample above):

cs.rtp.get_session(project_uid=project_uid, session_uid=session_uid)['uid']

Thank you, it works.