AnalyseFile - POST
|
Path |
/api/projects/{projectId}/metavault/sourcesystems/{sourceNameOrId}/datapackages/{dataPackageNameOrId}/analysefile |
|---|---|
|
Http Method |
POST |
Overview
Upload a csv or xlsx file to retrieve column information about their columns.
Required permissions
None
Request
Path parameters
|
Parameter |
Type |
Required |
Description |
Example |
|---|---|---|---|---|
|
sourceNameOrId |
string |
Yes |
This parameter is not actually used. |
|
|
dataPackageNameOrId |
string |
Yes |
This parameter is not actually used. |
|
Query parameters
|
Parameter |
Type |
Required |
Description |
Example |
|---|---|---|---|---|
|
options.sheetName |
string |
No |
Xlsx only. The name of the work sheet in the file to import/analyse. By default, the first or only one is taken. |
|
|
options.lineOffset |
integer |
No |
Xlsx only. Number of lines to skip in the imported/analysed file. Defaults to 0. |
|
|
options.headers |
bool |
No |
Whether the imported file has headers or not (for column names). This options sets the analysis to use the values of the first row as column names. Defaults to true. |
|
|
options.includeEmptyRows |
bool |
No |
Xlsx only. When importing data, consider the empty lines as part of the data. Defaults to false. |
|
|
options.separator |
string |
No |
CSV only. The separator between the fields. Defaults to |
|
Request body
The raw contents of the file to analyze.
Note: The Content-Type of the request should be set to one of:
-
text/csv: For CSV files -
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet: For xlsx
Response
Success response (200 OK)
{
"columns": [
{
"name": "mail",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
},
{
"name": "name",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
},
{
"name": "color",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
},
{
"name": "favorite_movie",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
},
{
"name": "relevance",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
}
]
}