Data
Turn a spreadsheet into the tab-separated file every import operation starts from.
Every import in this API starts here. data/spreadsheet/parse takes an uploaded spreadsheet, converts it to a tab-separated file on the server, and returns that file's name along with a preview of the parsed rows.
The returned name is what the import operations take as filename: geofence import, place import, employee import, vehicle import, and the rest. The two remaining operations here read the import processes that follow.
API actions
API base path: /data.
Operations that list no errors of their own return only the general error codes.
Upload a spreadsheet, convert it to a tab-separated file on the server, and return its name plus a preview of the parsed rows.
This is the first step of every import. The returned name is what place/import/start, employee/import/start and the other import operations take as filename.
This is a multipart request, not JSON: multipart/form-data with the spreadsheet in a part named file. A JSON body returns error 5, "Wrong request format".
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
The spreadsheet to upload, in XLSX, XLS or CSV format.
How many parsed rows to return as a preview. From 1 to 20.
Whether to read the first row as a header rather than as data.
When parse_header is true, a JSON map of column name to field identifier, such as {"Label": "label", "Latitude": "lat"}.
The parsed spreadsheet
true if request finished successfully.
trueName of the server-side TSV file, to pass to an import operation as filename.
Bad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error 234: the file could not be parsed as a spreadsheet.
Error response object
POST /v2/data/spreadsheet/parse HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: multipart/form-data
Accept: */*
Content-Length: 75
{
"file": "binary",
"preview_count": 1,
"parse_header": true,
"header_map": "text"
}{
"success": true,
"file_id": "text",
"preview": [
{
"ANY_ADDITIONAL_PROPERTY": "anything"
}
]
}Errors
These errors come in addition to the general error codes:
234 - Invalid data format.
List the current user's unfinished import processes across all entity types at once.
This is the cross-family view. Each family also has its own list, such as place/import/list, which returns only that family's processes.
Callable with an empty body.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
Unfinished import processes
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/data/import/list HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 19
{
"types": [
"place"
]
}{
"success": true,
"list": [
{
"id": 1,
"user_id": 1,
"subuser_id": 1,
"created": "text",
"type": "place",
"params": {
"headers": [
"text"
],
"user_headers": [
"text"
]
},
"filename": "text",
"status": "created",
"status_change_date": "text",
"progress": {
"imported": 1,
"failed": 1,
"percent": null,
"processed_lines": 1,
"warnings": [
{
"line": 1,
"message": "text"
}
],
"errors": [
{
"line": 1,
"message": "text"
}
]
}
}
]
}Return one import process, given both its ID and its entity type.
type is required as well as process_id, because process IDs are only unique within a type. The per-family reads such as place/import/read know their own type and take the ID alone.
Either a user session hash or an API key, with the "NVX " prefix, for example "NVX 22eac1c27af4be7b9d04da2ce1af111b". Obtain a session hash from the userAuth operation, or create an API key from the API keys operations. A small number of operations accept a session hash only and reject an API key with error code 4; each says so in its description.
ID of the import process.
Which kind of entity the import is for.
The import process
true if request finished successfully.
trueBad request. The response body carries the API-level error code in status.code. Validation failures also include an errors array naming each offending parameter.
Error response object
POST /v2/data/import/read HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 31
{
"process_id": 1,
"type": "place"
}{
"success": true,
"value": {
"id": 1,
"user_id": 1,
"subuser_id": 1,
"created": "text",
"type": "place",
"params": {
"headers": [
"text"
],
"user_headers": [
"text"
]
},
"filename": "text",
"status": "created",
"status_change_date": "text",
"progress": {
"imported": 1,
"failed": 1,
"percent": null,
"processed_lines": 1,
"warnings": [
{
"line": 1,
"message": "text"
}
],
"errors": [
{
"line": 1,
"message": "text"
}
]
}
}
}Errors
These errors come in addition to the general error codes:
201 - Not found in the database.
Last updated
Was this helpful?