Token need to get from response and pass in other api | Rest Assured Training

Rest Assured Training Forum

Token need to get from response and pass in other api

R
ruma Post on 29/11/2019

Scenario:

1)I have user api which  has payload email,password

2)post request

3) it will generate token in response

4) This token how to get automatically from response

5) So can pass in next api

Note: need your assistance

R
ruma Reply on 29/11/2019

Its resolved

String response1=RestAssured.given().contentType(ContentType.JSON).log().all().when().body(obj).when().post().then().extract().path("token").toString();

S
Support Team Reply on 30/11/2019

Yes .. coreect...