Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support API endpoint to get iTwin Account #27

Closed
ben-bartholomew opened this issue Apr 23, 2024 · 2 comments · Fixed by #28
Closed

Feature Request: Support API endpoint to get iTwin Account #27

ben-bartholomew opened this issue Apr 23, 2024 · 2 comments · Fixed by #28
Assignees

Comments

@ben-bartholomew
Copy link
Contributor

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 another getAsync 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.

@davidhjones
Copy link
Collaborator

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.

@ben-bartholomew
Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants