This article describes how to create a REST broker service instance using example RPA Central API Swagger files to work with Nintex RPA Central from Nintex K2 Five.
The RPA Central API uses Windows Integrated authentication, so be sure to use an identity that has administrative access in RPA Central. If you do not want to allow some of the actions from K2, use a designer or participant in RPA Central, depending on your scenario.
There are two limitations when using the REST broker with the RPA Central API. These are due to K2 Five not supporting enumerations.
Before you see SmartObjects and methods, you must do the following:
RPA Central API Swagger
Action | Endpoint | Method type |
Get a list of input variables | /api/jobbotflows/{jobBotflowId}/get-input-variables | GET |
Run a botflow on a bot | /api/jobbotflows/{jobBotflowId}/run-on-bot/{botId} | POST |
Run a botflow | /api/jobbotflows/{jobBotflowId}/run | POST |
Get a JobBotflow detail by id | /api/jobbotflows/{jobBotflowId}/detail | GET |
Get a JobBotflow by id | /api/jobbotflows/{jobBotflowId} | GET |
Get all the JobBotflows that are not deleted | /api/jobbotflows | GET |
Get the details for an instance by id | /api/instances/{instanceId}/detail | GET |
Get an instance by id | /api/instances/{instanceId} | GET |
Get a list of instances | /api/instances | GET |
Get botflows assigned to a bot by id | /api/bots/{botId}/get-jobbotflow-counts | GET |
Get a list of bots | /api/bots | GET |
RPA Central Management API Swagger
Action | Endpoint | Method type |
Get application info | /api/applicationinfo | GET |
Get the user's information | /api/users/domain/{domain}/name/{name} | GET |
Get the list of users | /api/users | GET |
Get the user's information | /api/users/{username} | GET |
Get the logged-on user's information | /api/users/currentuser | GET |
Add a user | /api/users | POST |
Delete a user | /api/users/{userId} | DELETE |
The resulting SmartObjects appear as follows:
The main SmartObjects and the methods you use to work with RPA are:
RPA Central API Swagger
RPA Central Management API Swagger
The following RPA automation scenarios are possible by calling SmartObject methods created with Swagger.
Use the RunBotflow or RunBotflowOnBot methods of the Botflow object. Returned from this method is the botflow instance ID which you can then use in the GetBotflowInstanceById method to query the status of the botflow. Note that the RPA Central API does not contain a method that allows you to pass in a callback URL for RPA Central to call when the botflow instance is completed.
Use the RunBotflow or RunBotflowOnBot methods of the Botflow object. First run the GetAllBotflows method to get the ID of the botflow you want to start, then use the ID with the GetInputVariables method of the InputVariables object. Note that you can’t get the data type of the input variables, so you’ll have to know what those are by looking at the botflow.
Pass a JSON-formatted string with the input variable names and values, such as the following:
Use the GetListOfBotflowInstances method of the Botflow object. Once you have the ID of a particular botflow, you can get details about a specific botflow instance.
To deserialize a botflow error, use the GetListOfBotflowInstances method to get a list of all botflow instances and their IDs. Then use the ID in the GetBotflowInstanceById method to get the details including an ErrorDetail object. Take the serialized ErrorDetail object string and deserialize it using the String system type to get the actual error.
Use the GetBotflowInstanceDetailsById to return the bots assigned to that botflow.
Use the GetAllUsers method of the User object to get a list of current users. You can AddUser by serializing a UserDetail object and passing that as a parameter to this method. You can DeleteUser by ID.
There are a few other methods that you may want to use, but these are the main methods.