I have an API which has response as below:
"message": "Success!",
"user": {
"id": 17,
"first_name_kanji_or_hiragana": "Hiragana",
"last_name_kanji_or_hiragana": "Name",
"first_name_katakana": null,
"last_name_katakana": null,
"email": "user@example.com",
"image_path": null,
"email_verified_at": "2019-03-06 04:44:46",
"type": "admin",
"created_at": "2019-03-06 04:44:46",
"updated_at": "2019-03-06 04:44:46",
"deleted_at": null,
"full_name": "Name Hiragana",
"full_image_path": null,
"roles": [
Each time when i am running the API new user id
is generating. What i want to do is that i want to fetch the id each time i run the api & then want to use that id in next response.
I have used below code to fetch the id but it's not working
pm.test(responseBody, true)
var jsonData = JSON.parse(responseBody);
jsonData.data.user[0].id