I have a requirement for a Web service connector application to Create account for user using multiple calls. There are 2 APIs given to us and they have to be called one after the other. I have created 2 Create Operation . When requesting for an entitlement for an user I can see user is getting created in the first API but I am getting an error in the 2nd API which says Exception occurred while performing ‘Create’ operation on identity ‘null’: Url: ‘members’ parameter does not contain the mandatory value ‘member_id’.",“error_message_parameters”:[“members”,“member_id”]HTTP Error Code: 400. Do we need a getobject Operation for this or do we need to write a after operation rule?
You can achieve this by using a parent-child HTTP Create account operation. First, take the response from the parent endpoint’s create operation and use that in the child operation.
If this approach doesn’t work, then I recommend using the AfterOperation rule as an alternative.
Is there any relation between these 2 API calls? ie value returned from first call to be used in second call?
I would always use BeforeOperation or AfterOperation rule in such a scenario.
There isnt any particular reason behind 2 API calls just the requirement is like this. I created 2 create account operation. seems like I can fetch the user in both APIs now. But now when I added the delete account operation I’m getting this invalid token header when I am running the account aggregation. Http error code 403 again and again. I keep getting this error evrytime I’m adding any new operation even though I have added the token header everywhere.
@Rohit_Sahu Parent-Child chaining of HTTP operation can only can be done on : Aggregation, Delta Aggregation, Get Object, Group Aggregation
In essence, any HTTP operation type that is responsible to fetch data in Web Services connector, only those operations can be chained together.
@Suchi1234 For this error, I would recommend to validate if the “Create Account” operation has the response mapping in place in case your account id is generated on the target app side.
Your best bet here would be to go the approach of afterOperation rule. However, I can suggest a workaround mentioned below so that you can try:
By default, the Web Services source creates an account for a “Create Account” operation and then adds the entitlements one by one.
For example, if there are three entitlements (Role, Group, Profile), the source will execute three requests and 3 API calls will be sent.
In your case what you can do is, configure the “Create Account” operation with whatever API you need to call first and then right below, create an “Add Entitlement” operation and have the context URL and other details mapped as per your 2nd create request.
This should force your connector to execute them one by one. (1st : Create Account op with your first API call, 2nd : Add Entitlement op with your second create related API call)
Note: There’s a caveat here with this approach. If your 2nd API calls needs any attribute value of the first API call response, then this approach wouldn’t work. In such case, afterOperation rule is the approach you must take.
I am trying to create 2 operations but somehow my account aggregation keeps failing. Not sure if it the create account operation or the target side. Do u have any reference code I can follow to create a after operation for calling 2 APIs?
This statement is very confusing. Your account aggregation and create account operations are nowhere related to each other in this context. Those are 2 different issues.
Can you share what’s the error you’re seeing on the failed account aggregation?