Generate excel files from given xml, json and dataset/collection in no time with REST based APIs. Additionally, you can easily convert between various workbook formats by consuming REST API service. Source the data- to generate excel and convert between excel format- from remote or local storage, or upload the data from client.
Your client application sends an HTTP request to the Web API service application. This request uses GET and POST methods to seek a response from the service. While, GET method retrieves the intended information from the resource specified, POST method submits the data to the resource.
To generate excel workbook in the desired format from the data that is present in a storage (local or remote), you need to use GET method. In this case, storage location along with file format of generated excel is specified in the request URL, as: GET: http://[:port]/api/excel?FileName=<>&type=<>&datafilename=<>
GET Request Schema to Generate Excel from xml
The following illustration depicts a request URL with parameters to generate excel in a desired format, from xml data file available in storage.
The following table elaborates request URL parameters (to generate excel from xml data file in storage) and their respective supported values.
Parameter |
Values Supported |
Description |
FileName |
String |
Name of the generated excel file, to be specified by the user. |
Type |
json, xlsx, xls, csv, xml |
File format of the excel, generated through the service. |
DataFileName |
data file name that storage manager recognizes |
xml data file that is available in storage. |
GET Request Schema to Generate Excel from Dataset/Collection
The following illustration depicts a request URL with parameters to generate excel in a desired format, from dataset/collection configured in storage.
The following table elaborates request URL parameters (to generate excel from dataset/collection configured in storage) and their respective supported values.
Parameter |
Values Supported |
Description |
FileName |
String |
Name of the generated excel file, to be specified by the user. |
Type |
json, xlsx, xls, csv, xml |
File format of the excel, generated through the service. |
DataName |
data name that data provider recognizes |
Dataset or data collection that is configured in storage. |
GET Request Schema to Convert Excel Format
The following illustration depicts a request URL with parameters to convert excel file available in storage to a desired format.
The following table elaborates request URL parameters (to convert excel file from storage to a desired format) and their respective supported values.
Parameter |
Values Supported |
Description |
FileName |
String |
Name of the generated excel file, to be specified by the user. |
Type |
json, xlsx, xls, csv, xml |
File format of the converted excel. |
WorkBookFileName |
excel file name that storage manager recognizes |
Excel file to convert, that is available in storage. |
POST Request Schema to Generate Excel from xml Posted from Client
POST method is used if the data does not reside in storage, and is provided through client. Here, the parameters of query string are sent in the HTTP message body of the POST request instead of the URL. The request URL for POST appears as: POST: http://[:port]/api/excel
The following table elaborates query parameters for POST request (to generate excel from xml data posted from client) and their respective supported values.
Parameter |
Values Supported |
Description |
FileName |
String |
Name of the generated excel file, to be specified by the user. |
Type |
json, xlsx, xls, csv, xml |
File format of the excel, generated through the service. |
DataFile |
xml |
xml data to be uploaded from client, its content is collection-like (a root element with multiple same elements as its children). |
POST Request Schema to Generate Excel from json Posted from Client
The following table elaborates query parameters for POST request (to generate excel from json data posted from client) and their respective supported values.
Parameter |
Values Supported |
Description |
FileName |
String |
Name of the generated excel file, to be specified by the user. |
Type |
json, xlsx, xls, csv, xml |
File format of the excel, generated through the service. |
Data |
json |
json data to be uploaded from client. |
POST Request Schema to Convert Excel Format
The following table elaborates query parameters for POST request (to convert excel posted from client to a desired format) and their respective supported values.
Parameter |
Values Supported |
Description |
FileName |
String |
Name of the generated excel file, to be specified by the user. |
Type |
json, xlsx, xls, csv, xml |
File format of the converted excel. |
WorkbookFile |
xls, xlsx, csv |
Excel file to convert, to be uploaded from client. |
Here, users need not specify the query parameters in the request URL. The following topics (Generate Excel from XML Posted from Client, Generate Excel from JSON Data Posted from Client, and Convert Workbook Formats using Data Posted from Client) discuss how the parameters of query string are sent in the HTTP message body in POST request.