Hello everyone. I was wondering if anyone can point me in the right direction.
I make a Post call that should return a response like this :
{
"totalResult": 70,
"page": 1,
"pageSize": 25,
"pageResult": 25,
"cacheKey": "Cache:OfferingFilters:eyJTb3J0IjoxLCJGajEyIl19fQ==:Consolidated:Descending",
"result": [{
"tag": [{
"typeName": "AssetId",
"tagValue": [
"94846",
"87088",
"87089",
"85715",
"94847",
"94816",
"85716"
]
},
{
"typeName": "AssetConsolidationId",
"tagValue": [
"227"
]
},
{
"typeName": "Bathroom",
"tagValue": [
0.0,
2.0,
1.0
]
},
{
"typeName": "ParentCategory",
"tagValue": [
"Rooms/Suites"
]
}
]
}, {
"tag": [{
"typeName": "AssetId",
"tagValue": [
"R94846",
"R87088",
"R87089",
"R85715",
"R94847",
"R94815"
]
},
{
"typeName": "AssetConsolidationId",
"tagValue": [
"228"
]
},
{
"typeName": "Bathroom",
"tagValue": [
0.0,
2.0,
1.0
]
},
{
"typeName": "ParentCategory",
"tagValue": [
"Rooms/Suites"
]
}
]
}]
}
at this point, I just need any of the assetId returned:
so my script look something like this:
let consolidatedAssets = http.post(baseAPI + "/api/consolidated-assets", JSON.stringify(formdata2), filterAfterSearch)
resultsRT = ResultsResponseTrend.add(consolidatedAssets.timings.duration);
check(consolidatedAssets, { "Consolidated Assets": (r) => r.status === 200 });
//Parse consolidated Assets and get ID
let assetID = consolidatedAssets.json("result.1.tag.0.tagValue.0");
But I’m not getting anywhere anyone has any insights? it will be greatly appreciated
Thanks