Child-parent endpoint for getObject operation?

Hey, is it possible to have a child-parent endpoint for a single account aggregation (getObject)?

The platform I’m integrating has a few shortcomings:
The endpoint that can return a single user (api/user/userID) does not return the user role and the endpoint that does return the user role can not fetch a single user.
You can query the second endpoint by passing api/org/users/query=… but the only queryable fields are email, login and name, none of which I can pass during a getobject operation (at least to my knowledge, the documentation, of course, does not mention which variables are available. The only one that’s referenced is nativeIdentity, which in my case is the userID).

My intended solution for this is to have 2 get object operations:

First api call:

GET url/api/users/$getobject.nativeIdentity$

This returns a json where user email is present
Second api call:

GET url/api/org/users/?query=$response.email$

The results from the second call would be mapped to the schema.
In my mind this works, but the operation fails. If I initiate a single account aggregation, this is returned

IllegalStateException: Connector returned null ResourceObject using application=‘Grafana Staging [source]’ and identity=‘599’

I thought about changing the AccountID to the login/email value instead, but then I would have the same issue with enable/disable & modify account operations since userID needs to be passed. UserID is first aggregated during Create Account operation.

If anyone else runs into the same issue, then the solution is to add mapping to the parent endpoint. I was expecting to fetch the response from the parent endpoint directly via $response.\field$ but the response field you intend to use in the child endpoint needs to be mapped to the account schema first.

1 Like