curl --location --request POST 'https://anypoint.mulesoft.com/accounts/api/v2/oauth2/token' \ (1)
--header 'Content-Type: application/json' \
--data-raw '{
"grant_type": "client_credentials",
"client_id": "<connected-app-client-id>", (2)
"client_secret": "<connected-app-client-secret>" (3)
}'
Processing Documents and Retrieving Results With RPA
You can execute your published document actions with MuleSoft RPA by using the Submit Document to MuleSoft IDP and Retrieve Results from MuleSoft IDP action steps in your automation projects. After you publish a document action to Anypoint Exchange, it becomes available for consumption in RPA. You must create a connected app and obtain the access token before you can use the IDP action steps in RPA.
If you aren’t using RPA to execute your document actions, configure and call the IDP API, as described in Processing Documents and Retrieving Results With the API.
Before You Begin
Ensure you have the following Anypoint permissions:
- Execute Published Actions
-
Enables a user to execute a published document action and retrieve the results of the execution.
Create a Connected App
To communicate with the IDP API, create a connected app with the following details:
-
Type:
App acts on its own behalf (client credentials)
-
Scopes:
Execute Published Actions
After you create the connected app, copy its ID and Secret for further use when you obtain the access token.
For more information, see Connected Apps.
Obtain the Access Token
After you configure the connected app, use the following curl
command to get the token:
1 | If you are in the EU region, use the eu1.anypoint.mulesoft.com domain. |
2 | Replace <connected-app-client-id> with the client ID from your connected app. |
3 | Replace <connected-app-client-secret> with the client secret from your connected app. |
Use the access token when calling the IDP API.
Execute the Published Document Actions
To execute the published document actions, use the Submit Document to MuleSoft IDP action step in RPA. This action step enables you to browse through your published document actions and execute them by providing an Execution ID and the path to the file to process. Use the Execution ID when configuring the Retrieve Results from MuleSoft IDP action step to pull the results from the execution.
When you query a published document action, IDP uses the model selected in each prompt to extract the data for the corresponding field.
The Submit Document to MuleSoft IDP action step executes document actions by impersonating a user in your organization. Therefore, you must use authentication credentials of a user that has the Execute Published Actions permission in Anypoint Platform.
See Submit Document to MuleSoft IDP for configuration details.
Retrieve the Results of the Execution
To retrieve the results of a document action execution, use the Retrieve Results from MuleSoft IDP action step in RPA. This action step enables you to query the results of a document action execution by providing an Execution ID that you used before in the corresponding Submit Document to MuleSoft IDP execution.
When you query a published document action, IDP uses the model selected in each prompt to extract the data for the corresponding field.
See Retrieve Results from MuleSoft IDP for configuration details.