csv_export_documentation:csv_request_and_response
Export documentation: CSV parameters and response
Due to run-time restrictions, an export must be sequentially callable.
For this purpose, a start URL must be provided. The next URL to be called is indicated by Location
-Header (HTTP location).1)
This redirection is followed until a Location
-Header is no longer returned.
Parameters
For the incremental export, certain parameters of the Export-URL are supplied.
start
- Determines the first item (offset) to be exported.
limit
- Determines the interval size / number of items to be exported.
shopkey
- Determines the corresponding Findologic service for the items to be exported.
- A separate Findologic service is required for each language and subshop.
language
- Determines the language of the items to be exported.
Response
Possible outputs in the body of the script may include:
While the export is still running
SUCCESS: Unfinished
: The export is not complete yet; forwarding will occur to the next call.
When the export is completed
SUCCESS: Finished
: The export has been correctly completed.
FILE: <PATH_OF_THE_CSV>/<NAME_OF_THE_CSV_FILE>
: Output of the (absolute) path and file name (without domain).
In the case of an error during the export
ERROR
, <error message>
: An error has been found.
CSV file
The item data is being exported to a CSV file according to a corresponding format.
The file name has to be put out after the export (see example below).
Directory
The CSV file has to be created in the usual directory for exports that is defined in the shop system or (if not available) in the export path, which is set in the shop-backend.
Name
The name of the CSV has to be comprised as follows:
findologic_<shopid>_<language code>.csv
If there is no subshop function in the shop system, i.e. if only a main shop is being used, the default value for the shopid
is 0
.
Examples
The main shop is being exported in german language:
http://www.mein-shop.de/export/findologic_0_de.csv
A subshop with ID 2 is being exported in English:
http://www.mein-shop.de/export/findologic_2_en.csv
Process
- Start
- The export URL is called by Findologic with the parameters described above.
- Call:
http://www.example.com/findologic_export.php?start=0&limit=100&language=de&shopkey=ABCDABCDABCDABCDABCDABCDABCDABCD
- Initialisation
- The CSV file is emptied or created again with the corresponding file names.
- Export
- The number of items to be exported corresponds to the value of the
limit
parameter. - The index of the first item to be exported corresponds to the value of the
start
parameter (0-based). - The items are exported to the
CSV-file
.
- Response
- A redirect to the next page is returned.
HTTP/1.1 302 Found Location: http://www.mein-shop.de/findologic_export.php?start=100&limit=100&language=de&shopkey=ABCDABCDABCDABCDABCDABCDABCDABCD ... SUCCESS: Unfinished
- The value of the
start
parameter is the respective value of the laststart
parameter plus the value of the limit parameter. - The value of the
limit
parameter remains the same.
- Repeat until all products are exported. Stop redirecting then.
- If the last item has been exported, the relevant status message is put out:
HTTP/1.1 200 OK ... SUCCESS: Finished FILE: <PFAD_ZUR_CSV>/<CSV_DATEINAME>
- Download
- The
CSV
just created is imported by Findologic. - The product indexing is started by Findologic.
Example
- Start:
http://www.example.com/findologic_export.php?start=0&limit=1000&language=de&shopkey=ABCDABCDABCDABCDABCDABCDABCDABCD
- Response:
HTTP/1.1 302 Found Location: http://www.example.com/findologic_export.php?start=1000&limit=1000&language=de&shopkey=ABCDABCDABCDABCDABCDABCDABCDABCD ... SUCCESS: Unfinished
- Call:
http://www.example.com/findologic_export.php?start=1000&limit=1000&language=de&shopkey=ABCDABCDABCDABCDABCDABCDABCDABCD
- Response:
HTTP/1.1 200 OK ... SUCCESS: Finished FILE: findologic_1_de.csv
- Export successfully completed, CSV download
Other
.htaccess protection
The export script can also be in a .htaccess-protected area. For this purpose, you can store a user name and password in the Findologic customer account under Settings → Import/Export → Export Settings.
Load-Balancing
If you use load-balancing in your infrastructure, please ensure, that export calls are always forwarded to the same host or to a host that is outside the cluster. Otherwise the export cannot be completely generated because of the redirect chain.