Import Bulk Geolocation
The Import Bulk Geolocation API uploads large batches of individual geolocations included in a .CSV format. Once the .CSV file is uploaded successfully, the geolocations are queued into the Quantum Fabric Engagement Services.
This API first checks if the format of the file is correct and then performs the data insert or update. After this API is executed, the return message only indicates whether or not the format of the file is correct. Use the returned ID to call the Get File Upload Status by ID API to get the status of the import. To view the list of errors that may have occurred during the import, call the Get File Errors By Pagination API.
CSV File Format
CSV file should have the following data columns and the corresponding data. The order of the data elements may vary.
- NAME
- LATITUDE
- LONGITUDE
- RADIUS
- ALTITUDE
- DESCRIPTION
- TAGS
- METADATA
- CLIENT_ACTION
- MESSAGE
- CUSTOM_LOGIC
The first row in the CSV file must be a header line. The ideal file format in a sample CSV file is displayed below:
URL
The HTTP URL for Import Bulk Geolocation API is:
http://<<host>>:<<port>>/api/v1/geolocations/import
NOTE: Input Parameters.
- DELIMITER : The delimiter name.
- importType : Mode of import
- uploadFile : The file to be uploaded
NOTE: Ensure that the data in the file is properly escaped for the provided delimiter.
Method
POST
Because this API uploads a file, you must use the "multipart/form-data" encoding format. You must also provide the following request headers with the request.
- DELIMITER
The possible values for DELIMITER are:
- COMMA
- SEMI_COLON
- PIPE
- uploadFile - Points to the name of the file that is uploaded.
- importType - Default value is insert.
The possible values for importType are:
- insert - This option reads the data in the CSV file and attempts to perform an insert. If the insert fails, an error is thrown.
- upsert - This option reads the data in the CSV file and attempts to perform an update of each record. If the update fails, the record is inserted.
- delsert - This option deletes all existing data and performs an insert of the data in the CSV file. It is strongly recommended that you back up your data before choosing this option.
Input Parameters
The following fields are input parameters:
Sample Response
{ "id" : "6043561523913209695", "message" : "File uploaded successfully, import is in progress." }
Response Code
Code | Description |
---|---|
Status 200 | File uploaded successfully, import is in progress |
Status 400 | No file or empty file uploaded Please upload a valid CSV file Invalid delimiter value provided |
Status 401 | Unauthorized request |
Status 500 | Server failure to process request |
The status of the bulk push message upload can be viewed under Settings > Status > File Upload section in console or refer Administration > Get File Upload Status by ID API.