Closed ben-bartholomew closed 1 month ago
It was not deliberately left out, feel free to submit a PR if you'd like!
With that being said, there is a method which might work for your purpose: getPrimaryAccountAsync
. This will retrieve the user's (user in the access token) primary account. Assuming the iTwin is in the same organization as the user, this is likely the same Account.
Thanks for the details David, we have a niche case where we need to get the account of the iTwin where it can be different from what the user's primary account is, so I put up a PR.
The current iTwins REST API has an endpoint to retrieve the Account for an iTwin which is missing from the iTwinAccessClient:
https://qa-developer.bentley.com/apis/itwins/operations/get-itwin-account/
As it works now you would have to make two calls, one to
getAsync
to get the actual iTwin (and thus the iTwinAccountId), and then anothergetAsync
with the iTwinAccountId to get the properties on the Account.Was this deliberately left out of the iTwinsAccessClient? If not I would be happy to submit a PR.