Workaround For Accessing The DataService API Using An Application Scope

How to use the DataService API in the background, when there is no option for using an Application scopes?

Issue Description:

The current iteration of the UiPath DataService API is designed to support User Scope only for authentication. This presents limitations for scenarios where user interaction is not desired or feasible during the API authentication process.

User Scope vs Application Scope

  • User Scope: This method of authentication necessitates that a specific user authenticates and interacts with the DataService API. It is useful for activities that act on behalf of a user, but cannot run in the background.
  • Use Case for User Scope: Imagine a scenario where an individual user wants to fetch their own task list from a UiPath Orchestrator. The user-specific scope ensures that the person retrieves only the tasks allocated to them, maintaining the integrity and privacy of the data.
  • Application Scope: Unlike User Scope, this method allows an application itself to authenticate and interact with the DataService API without the need for user intervention. This is especially beneficial for automated processes that run in the background.
  • Use Case for Application Scope: Consider an automated report generation system that needs to fetch various data points from different parts of the Orchestrator. Using Application Scope ensures that the system can operate independently, without requiring user authentication each time data needs to be retrieved.


Resolution: Workaround for Enabling Application-Like Authentication Scope Behavior in Automation Cloud.

While UiPath has not officially documented this feature, there is a workaround available within the Automation Cloud that enables fine-grained access controls suitable for Application Scope on the DataService API.

Steps to enable Application Scope within Automation Cloud

  1. Navigate to the Automation Cloud Dashboard and log in as an 'Organization Administrator'
  2. Go to 'Admin Console', make sure that the organization is selected at the top of the left pane, and then click 'External Applications'
  3. In the top right, click 'Add Application'.
    1. Fill in the Application Name field
    2. Select 'Confidential application' for the Application Type
    3. Under Resources, leave the 'Scopes' section blank
  4. (Optional) Add a URL in the 'Redirect URL' field
  5. Click 'Add' to create the registration
    • A confirmation message opens. Note the value of the App ID and its associated secret. These two values will be used for authenticating to the service.


Adding the External Application to Data Service with required roles

  1. Login to Automation Cloud and navigate to Data Service
  2. On the Data Service tab, click the More Options menu in the upper right corner
image.png
  1. Select Manage Access. The Manage Access page is displayed. Navigate to 'Assign Roles'
image.png
  1. Provide the name of the External application, check the necessary roles, and click on 'Save'
image.png



Setting up the DataService API authentication in UiPath Studio (v22.10.X or later)

  1. Within the Studio project, create the following variables

Note: The value for the variable 'scope_platform' must be set to "DataService.Default"

  1. In the 'HTTP Request Activity', use the 'HTTP Request Wizard' and fill out the parameters below

  1. Clicking 'Preview', if all the parameters are successful, you should see a successful connection response (status 200) returned
  2. Add a 'JSON Deserialize' Activity from the 'UiPath.WebAPI.Activities' library

  1. Add an 'Assign' Activity with the following value
    • Save to: accessToken
    • Value to save: authReponseobj("access_token").ToString


  1. All the components should now be present to authenticate to the DataService API.
Below is an example sequence containing a full DataService API Authentication request and DataService API Call request: