-Before writing any code, it’s important to understand what data is required to invite a user. According to the [API reference](https://developer.greenlake.hpe.com/docs/greenlake/services/iam/workspaces/public/openapi/workspaces-v1/operation/invite_user_to_account_identity_v1_users_post/), one simply needs the email address of the invited user. That’s easy! In the documentation, you can also see that there is no way to select a workspace to invite the user to. The reason for this is that the API credentials used to make the call is workspace specific, so it implicitly provides the workspace to which the user will be invited to. This means that one needs to collect API access credentials for every workspace that to the users are added to. For the script I am writing here, in a Workspace tab, I have stored the Client Id corresponding to API Access of a given Workspace. Because I don’t want to save Client Secrets, I will prompt for them and store them in memory.
0 commit comments