It is easy to use the GoodGrids API with PHP to convert CSV files into Excel spreadsheets. You can create an Excel file from a CSV file with this simple snippet of code:
<?php // Point to where you downloaded the httpful phar include('./httpful.phar'); $goodgrids_api_url = "https://api.goodgrids.com/api/convert/v1/csv-to-excel/3a6c0d9ac7c74d"; $request = \Httpful\Request::post($goodgrids_api_url); $request->sendsType(Httpful\Mime::FORM); $files = array( 'file' => './some_file.csv' ); $request->attach($files); $response = $request->send(); $excel_file_content = $response->body;
Make sure to set
$goodgrids_api_url to the API URL of the CSV-to-Excel conversion configuration you want to use.
This snippet of code uses the Httpful REST API client for PHP. You can adapt this code to use whichever client library you want.
Found a bug? Have a suggestion on how to improve this documentation? Please send us a note at email@example.com.