In some cases, you may way to convert the API response you receive from Flow into a CSV for additional data manipulation and exploration.
If you're extracting data through any of the Customer APIs, the ability to receive a response in CSV format is built natively into the API itself. Attach format=csv
as a parameter in your API request to automatically receive the response in CSV format. Use additional parameters as usual.
Your request will look something like: https://flow.pluralsight.com/v3/customer/core/commits/?format=csv
.
For other Flow APIs, such as the Metrics APIs, or if you already have your response in a JSON format, you'll need to use a third-party tool or custom script to convert your JSON response to CSV. The tool you use will depend on your organization.
For most simple conversions, we recommend using Microsoft Excel's built-in functionality to import data from JSON files. To convert your API JSON response to CSV:
- Download your API response into a JSON file. Most third-party API tools like Postman have several options to do this.
- In Excel, import the JSON file (external site, opens in new tab).
- Convert the data to a table, and click the expander symbol in the column names to expand all columns and show all data. No columns should contain variables like
{list}
or{record}
when you're done.
Tip: If you're unable to expand a column that should be expanded, you may need to delete header rows that are not part of the response, like count, next, and previous.
- Once the columns are all expanded, close and load the table into your sheet.
From here, you can export this sheet as a CSV or continue to do your data manipulation in Excel.