SAP Logo LeanIX is now part of SAP
Solved

Which API do I use to list all my Users that can be added as Subscribers to a FactSheet

  • 19 April 2024
  • 4 replies
  • 90 views

Hi All, 

I’m looking to create basic FactSheet entries from a Project Governance system called Uppwise.

This is just a basic integration to LeanIX using a GraphQL client generated using the Netfilx DGS codegen plugin. Having got past some dependency problems, this now works well. I can also connect to the Pathfinder Rest API.

However, I’m struggling to work out where I can get a list of my Users that I can use to add as subscribers.

I can’t seem to call the MTM service, but I'm not sure if I should be able to.

 

Could someone point me to which API I should call?

 

Thanks

Andrew

 

icon

Best answer by Thomas Schreiner 19 April 2024, 20:56

View original

4 replies

Userlevel 6
Badge +2

Hi @Gundalf,

I will answer this question by posting my 4-years-old feature request :-) It shows what API endpoints I am using for LeanIX Automation Platform, and why each of the 3 options is not perfect. If your requirements are a bit lower than mine, one of the options might work for you.

Maybe @Kostas-LeanIX knows if there’s already something better in the pipes?

There we go:

—-

As discussed with Felix recently, I am creating a feature request for a lean MTM API endpoint for users and permissions.

As a LeanIX partner who is developing automation solutions for LeanIX, I need a fast way to reload all users and permissions when reacting to a Webhook event. "Fast" means "faster than the maximum Webhook processing time of 50 seconds, for *any* customer workspace, no matter how many users they have".

With the current set of endpoints in the MTM API, I face the following problems:

- The "/workspaces/{id}/permissions" endpoint returns huge amounts of data and is virtually unusable for workspaces with many users
- The "/workspaces/{id}/users" endpoint is lean, but it does not provide workspace-specific data, such as the user's role (ADMIN, MEMBER, VIEWER)
- The GraphQL MTM endpoint "/services/mtm/v1/graphql" is awesome (really!), but it's not "officially" available to be used by customers and partners, so I am facing a long-term risk if I use it to build my solutions.

My preferred solution would be to get your permission to officially use the GraphQL MTM endpoint within my partner solution. I already tested it and it works just perfectly.
—-

Userlevel 3
Badge

Hi @Gundalf,

As @Thomas Schreiner mentioned, we expose this information through our REST MTM API endpoints (not GraphQL). 

Looking ahead, our journey of improvement is ongoing and your feedback plays a pivotal role in that. We're always assessing how we can enhance our offerings to better serve our customers.

So, keep the questions and feedback coming 😊! Helping us continue to grow 🚀, innovate, and deliver the best possible experience.

Hi @Thomas Schreiner,

Thanks for the help there. I was failing to find what I needed. Endpoints that looked like what I needed were all Internal to LeanIX. 

As you say, neither of the Rest endpoints is ideal -

  • /workspaces/{id}/users is lightweight but returns all users  - no filter option
  • /workspaces/{id}/permissions can be filtered, but has a large payload.

I could work with these to solve my issue. 

The undocumented GraphQL MTM endpoint looks better for my needs. I did manage to connected to it MTM Graphql endpoint, downloaded the schema, and generated client code. I now have understand how to call it. It might be I need a detour to understand GraphQL better.

Thanks again

Andrew

Userlevel 6
Badge +2

So, keep the questions and feedback coming 😊! Helping us continue to grow 🚀, innovate, and deliver the best possible experience.

@Kostas-LeanIX Thanks! It would be really awesome if there was a better solution than an undocumented endpoint. Do you see any possibility how we could fix this? Maybe by officially releasing the MTM GraphQL API, or by enhancing the MTM REST API?

Reply