An automation developer is using the HTTP Request activity in UiPath Studio to call a REST API that requires a bearer token. The token is stored in Orchestrator as an asset named "APIToken". The developer needs to include the token in the request header. Which approach should be used?
This is correct because the HTTP Request activity allows custom headers. The Get Asset activity retrieves the token from Orchestrator, and the header must be formatted as "Bearer <token>". This is the standard way to pass a bearer token in a header for REST APIs.
Why this answer
The correct approach is to retrieve the token from Orchestrator using the Get Asset activity and then add it to the request headers as "Authorization: Bearer <token>". This is the standard method for bearer token authentication in REST APIs and is fully supported by the HTTP Request activity through its Headers property.
Exam trap
The trap here is assuming that the HTTP Request activity has built-in authentication types for bearer tokens, when in fact it requires manual header configuration.