Place import
Create many places at once from a spreadsheet, through a background import process.
Place import creates many places at once from a spreadsheet, rather than one call per place.
Convert the spreadsheet first with data/spreadsheet/parse, which stores it as a tab-separated file and returns its name. Pass that name to place/import/start as filename, follow the process with read or list, collect the rows that failed validation with download_failed, and close the finished process with finish.
Address and coordinates complete each other. A row that gives only an address gets its coordinates by geocoding, and a row that gives only coordinates gets its address by reverse geocoding. Tags that do not exist yet are created, within the user's quota for tags.
Import process object
API actions
API base path: /place/import.
Operations that list no errors of their own return only the general error codes.
Available fields for headers:
labeladdresslatlngradius(default is 100 if not specified)descriptiontagscustom field ID as a string, e.g.
"131312"(see entity/fields)undefined(if a meaning of a field is not known)
For custom fields of type employee and multi_employee, values are matched with the user's employees by full name. For multi_employee fields, multiple names can be listed separated by commas or semicolons.
A place is not imported if a required custom field is missing or holds an invalid value. Invalid values of non-required custom fields are skipped with a warning.
Required sub-user rights: place_update.
Start the background process that imports points of interest from a preloaded TSV file, and return the process ID.
Create the file first with data/spreadsheet/parse, which converts a spreadsheet to TSV and returns its name as file_id. Pass that name here as filename.
Address and coordinates complete each other: given only an address the coordinates come from geocoding, and given only coordinates the address comes from reverse geocoding.
Tags that do not exist yet are created automatically, within the user's tag quota.
A POI is not imported when a required custom field is missing or invalid. An invalid value in a custom field that is not required is skipped with a warning.
Requires the place_update right.
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.
Name of the server-side TSV file, as returned by data/spreadsheet/parse in its file_id. Must not be empty.
What each column of the file holds, in order. Must not be empty. Accepted names are label, address, lat, lng, radius which defaults to 100, description, tags, a custom field ID as a string such as "131312", and undefined for a column whose meaning is not known.
For custom fields of type employee and multi_employee the value is matched against the user's employees by full name. A multi_employee field takes several names separated by commas or semicolons.
Optional. Display labels for the columns. Must be the same length as headers.
The started import
true if request finished successfully.
trueID of the created import process.
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 233: the preloaded file was not found. Error 234: the file is not a TSV.
Error 247: an identical import already exists for the same file.
Error 15: too many requests, when too many imports are already in progress.
Error response object
POST /v2/place/import/start HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 62
{
"filename": "text",
"headers": [
"text"
],
"user_headers": [
"text"
]
}{
"success": true,
"id": 1
}Errors
These errors come in addition to the general error codes:
15 - Too many requests (rate limit exceeded) - if too many imports in progress
233 - No data file - if the preloaded file is not found
234 - Invalid data format - if the file is not a TSV
247 - Entity already exists - there is another identical import with the same file
Return one POI import process by ID, including its progress.
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.
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/place/import/read HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"process_id": 1
}{
"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 database (if import is not found)
List the current user's unfinished POI import processes, meaning those with status created, in_progress, done or failed.
A process marked finished with place/import/finish drops out of this list.
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/place/import/list HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Accept: */*
{
"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 a file of the rows that failed validation, so they can be corrected and imported again.
The response is the file itself, not a JSON envelope.
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.
The failed rows as a file
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 204: the file of failed rows was not found.
Error response object
POST /v2/place/import/download_failed HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"process_id": 1
}binaryErrors
These errors come in addition to the general error codes:
201 - Not found in database (if import is not found)
204 - Entity not found (if file is not found)
Mark an import process as finished, which drops it out of place/import/list.
Only a process that has stopped can be finished. One still running returns error 280.
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.
Import marked finished
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/place/import/finish HTTP/1.1
Host: api.eu.navixy.com
Authorization: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"process_id": 1
}{
"success": true
}Errors
These errors come in addition to the general error codes:
201 - Not found in database (if import is not found)
280 - Invalid import request state (if the import process is still in progress)
Last updated
Was this helpful?