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.
Columns returned by this call are guaranteed to be valid parameters for the columns in the API call to create a datapackage table: Metavault API - Create data package table
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)
Starting from 7.0.0 a default business name is also generated, using the name.
{
"columns": [
{
"name": "mail",
"businessName": "mail",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
},
{
"name": "name",
"businessName": "name",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
},
{
"name": "color",
"businessName": "color",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
},
{
"name": "favorite_movie",
"businessName": "favorite_movie",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
},
{
"name": "relevance",
"businessName": "relevance",
"dataType": "String",
"length": 255,
"nullable": true,
"primaryKey": false
}
]
}