Juniper Networks interview question

Q:Explain how will you parse API JSON response which has variable fields and store it in CSV format?