This may be a quick one for experienced developers. I am looking to parse the JSON response below via Postman for specific values of named properties. Here is an example response:
[
{
"SubscriptionQty": "1.0",
"ProductName": "Product A",
"ProductId": "12345",
"AccountName": "Customer A",
"AccountId": "66723",
"ProductID": "7JQ-00341",
"Message": "successful"
},
{
"SubscriptionQty": "10.0",
"ProductName": "Product A",
"ProductId": "12345",
"AccountName": "Customer B",
"AccountId": "66746",
"ProductID": "7JQ-00341",
"Message": "successful"
}
]
What would be the best approach to parse the response as it will change over time?
Would it be possible via Postman to take the values for (SubscriptionQty, ProductId, and AccountId) for each Account, set them as env variables (Ex: customer_1_SubscriptionQty, customer_1_ProductId, customer_1_AccountId, next level down (customer_2_SubscriptionQty, customer_2_ProductId, customer_2_AccountId, etc) and then use those variables in another API call to post the data I require for each customer?
In the end, I am looking for a sound method to take the data for each property found, set it as defined variables for that customer and then take those values to utilize them in a second API call to post data for another piece of software. If I need to break this down further I am happy to. Just looking for the best possible method to approach this and Postman seemed to be appropriate with the options for env. variables and collection runner. Appreciate any and all assistance!