How to call a web service using token in UI path

I want to call a web service using token in UI path.

Hey @ShirinParkar

Go through below existing thread and you will get many linked posts too all are having the information which you are looking for :slight_smile:


1 Like

I am trying to call ‘’ service using HTTP request activity but it is giving Proxy Authentication Required error.

Hi @ShirinParkar

Could you provide some screenshots?

Have you tested your HTTP Request activity with a simple query, such as even this thread as url:

I’m facing the same issue, i need to automate the token generation with uipath and pass it in argument in http reques.
i have a private and public key, header and payload, but i couldn’t decode and hash to create the token using uipath.
Could you please help ?

Hi @hzarriq

Could you please provide more information? Showcasing how you are currently achieving the same flow in another tool such as Postman would help here.

i’m using, i pass header, payload, private key and public key ( which is authorised from the web service). i change the expiration date in the payload and the token is generated. this algorithm works this way : $jwt = $encodedHeader + ‘.’ + $encodedPayload +"." [convert]::ToBase64String($privateKey.SignData($toSign,“SHA256”)).
$toSign = $encodedHeader + ‘.’ + $encodedPayload
I also fount a java program that do the same, but for some security reasons i don’t have to invoke Java code.

java program
public String createToken(final String userId, final String username, final Set roles, final String realm) {
final Claims claims =;
final Date now = new Date();
final Date validity = new Date(now.getTime() + expiration);

    claims.put(USER_ID_KEY, userId);
    claims.put(USER_ROLES_KEY, roles);
    claims.put(REALM_KEY, realm != null? realm : DEFAULT_REALM);

    return Jwts.builder()
        .setHeaderParam("typ", "JWT")
        .signWith(SignatureAlgorithm.RS256, this.privateKey)

I think the first step would be to try and do the same action with Postman. Afterwards, it should be relatively straightforward to reproduce the same by using one (or several) HTTP Requests.

1 Like

Hi @Shirin i have this example that I use with students using OpenWeather API (3.6 KB)

Hope it helps!

1 Like