Web service connector before operation rule how to add methods

Hi, I am using web service connector to create account on target system. For now I have written one static json body content and processing it just to test if create account is working. This is fine but for my use case I need to create account based on dynamic inputs for users. For this I am thinking to use custom java codes and add it in before provision rule. Could you please suggest me how I can do this and also what is the best possible way to do this.

Use case - I have to fetch user name, employee id, email address from user profile and use rest api to create accounts, here I have to use sequence of 4 rest api which are inter dependent on each other. I have one java program where I am doing this and want to use similar methods in before rule java.

here are some methods I have-
CreateCyberarkAccount(String, String, String, String, String, OkHttpClient, String, String, String)
CreateCyberarkMultipleSafes(String, String, String, String, String, OkHttpClient, String)
CreateCyberarkSafe(String, String, String, String)
CreateCyberarkSafes(RequestBody, Response, OkHttpClient, String, String, String, MediaType, Request, String)
getAuthorizationPassword(OkHttpClient)
getAuthorizationToken(OkHttpClient)
getAuthorizationToken(OkHttpClient, String)
getCyberArkCPMUserName(String)
UpdateCyberarkMultipleSafeOperations(String, String, String, OkHttpClient)
UpdateCyberarkMultipleSafes(String, String, String, OkHttpClient)
UpdateCyberarkMultipleVaultAdmins(String, String, String, OkHttpClient)

Hi @hranjan3,

You can achieve the use-case by using before and after operation rule .In your use-case one primary request can be part of your body and then use after operation rule to call two different endpoints and perform the operation.

Kindly let me know if you need further input.

Thanks

1 Like

You can create a Form where users can insert the data and later launch a workflow with your code

1 Like

You are not supposed to send requests to any external APIs from cloud rules. In my opinion you should follow the approach suggested in this

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.