Skip to content

lamudi-gmbh/demo-csv-upload-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

csvdemo

CSV Upload API example

Setup

  • You need to have PHP 5.4 minimum

  • You need to run "php composer.phar install" from base_directory

  • Download import templates from BOB for your country and use them for your files as base

    • You can use several attributesets in one run (file convention like importtemplate_land__20141105165221_694858.csv for land)
  • There are 2 folders in data/csv/, one for new products (create) and other one for existing products (update).

    • To update products, put importtempate files there
    • To create new products, put importtemplate files there
  • Change the variable "bob.url" in "application/configs/application.ini", depending your current setup.

  • Change the variable "bob.user" in "application/configs/application.ini", depending your current setup.

  • Change the variable "bob.password" in "application/configs/application.ini", depending your current setup.

  • Start the local PHP Webserver with "cd public; php -S localhost:8000"

Run

If you want to integrate the CSV API into your own code, use following structure (its basically one http form upload with authentication)

curl -u USERNAME:PASSWORD --form file1=@PATH_TO_CSV "http://URL/import/csv/?attribute_set=ATTRIBUTESET&mode=update|create"

e.g.

curl -u john:doe --form file1=@products_apartment_20150701173133_028233.csv "http://bob.shop/import/csv/?attribute_set=apartment&mode=update"

OR

curl -u john:doe --form file1=@products_apartment_20150701173133_028233.csv "http://bob.shop/import/csv/?attribute_set=apartment&mode=create"

About

It is a demo implementation for our new CSV Upload API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •