How to get the Headers Value from json response

Hi Friends,

I have a situation where first I have to fire a json request to get the authorization key and then I have to use the key for other json request. how to get the header values in the json response to a variable.
Pls find the postman screen shot.

Hi @me.mohanraj,

Have you tried this?
You will get all the headers into a dictionary type variable and you will get the authorization header as header(“authorization”)… header is the variable name i used here

1 Like

Hi @HareeshMR,

Many Thanks for the reply. Thanks for ur time. I tried that.
But I am getting invalid request

Pls find PostMan Screen:
image

And where have to give this user name and password
I have given them in Simple Auth:

@me.mohanraj,

What’s the status of response you are getting?

I hope it is 403 …

The error is with the request I hope :slight_smile:

Can you try printing both status and result as in the screenshot…

In UIpath I can see as status code as 400
But in Postman : its is 204 No Content…

Yeah, 400 states that there is issue with the request, if you get 200 status code, then the request is processed correctly. I hope you know all these. If not, Try google the error codes and the status codes. You will understand a bit… :slight_smile:…

As per the screenshot and status, the request is bad. Please check @me.mohanraj

@me.mohanraj,

Have you tried changing the request?

Is it working? Are you able to get status code 200?

Hi @HareeshMR,

I cannot get the code as 200, again and again I am getting the 400 as status code. There is no request. only endpoint url:
" http://10.XXX.XXX.XXX:80/rest/Authentication "
If I hot this I can get the header . There is no Response in the BODY. only the headers I can get. Is there any other way to handle this. pls help me out…

@me.mohanraj,

Have you tried it in postman? Is it working?

If possible can you share the screenshots of the workflow you have so that I can understand what was the error?

@HareeshMR,

Please find the postman screen

You will get this for sure in UiPath as well @me.mohanraj,

Please make sure you are trying with the same creds and URL as in the postman… Drag the http activity and give the essential parameters and preview the response. There you will get what was the mistake you are doing.

image

For sure you will get this done as you are getting in Postman…

I am trying… pls guide me if I am doing anything wrong…

I am getting the same 400 when I see the preview

You are giving the credentials in the headers in the postman, so, you have to give the credentials in the headers as the request is build based on the header params. You dont need to use any authentication @me.mohanraj

Please see the screenshot below

Hi @me.mohanraj,

Any update… Please let me know if it works… The topic is interesting :smile:

Hareesh, I am sorry… I tried what you said… but now I get 401.

I am getting this Bro… wat I am doing wrong…

http://10…:80/rest/Authentication = Url
Uname :
Pword: Mwy9Np2wg5YsLsCE

Hareesh,

Hope the server is down, that’s the reason I am getting 401… Hope this should work when Backend is up… :slight_smile: I will post you the status once environment is up…

Hareesh,

I am trying to connect Oracle DB… do you have any idea reg the connection string to connect UI with Oracle… I tried with the options that I get from UIpath community forum… but all Vien…

@me.mohanraj,

have you tried these…

We have packages available in UiPath … try searching database in manage packages…

Here is the screenshot …