Need help in running rest api in jenkins job.

Hi,

I’m trying to run rest api in jenkins job but the job is failing.

Below is the script which is running properly from my laptop in Git Bash. but when i try to run the same in Execute Shell in jenkins it is failing. this script will fetch the session ID of an application and stores the session id in a variable var.

So can any one help me on this issue.

var=$(curl --silent ‘http://url/Login?sUserId=userid&sPassword=password’ | sed -nr ‘s/.>(.)<.*/\1/p’)

Thanks In Advance,
Phani