You can get build no from response headers, it gives queueNo which is buildNo+1.
headerName = location
location →http://:/queue/item/54/
here 54 is queueItemNo.
BuildNo would be queueItemNo-1 = 53
You will get this response when triggering job.
http://:/job/<job_name>/buildWithParameters?repository=<repo_name>&branch=<branch_name>
For above url to work you would be requiring jenkins-crumb.
http://13.232.201.103:8080/crumbIssuer/api/json
use basic authentication with postman.
In reponse to this u will get
{
"_class": "hudson.security.csrf.DefaultCrumbIssuer",
"crumb": "61b6dd4325d000f8b76e9d830fcab88e12d38315e4a7a858c70b838cf9f07d20",
"crumbRequestField": "Jenkins-Crumb"
}
Use Jenkins Crumb as header in point 1.
Jenkins-Crumb:61b6dd4325d000f8b76e9d830fcab88e12d38315e4a7a858c70b838cf9f07d20
JobNo = response.getHeaders().get("location").get(0).split("/")[5]-1;