-
-
Notifications
You must be signed in to change notification settings - Fork 951
API
Kiril Kirkov edited this page Feb 14, 2018
·
16 revisions
Hello. Api usage is very simple. There is list with available calls:
- http://yourshop.com/api/products/bg/get - returns all products with BG translation
- http://yourshop.com/api/product/bg/2/get - return one product with BG translation and id 2
- http://yourshop.com/api/product/set - Set product. Below you can read how the array should be built
- http://yourshop.com/api/product/11/delete - Delete product with ID - 11. Method must be DELETE.
`Array (
[translations] => Array
(
[0] => bg
[1] => en
[2] => gr
)
[title] => Array
(
[0] => текст
[1] => text
[2] => greek text
)
[basic_description] => Array
(
[0] => текст
[1] => text
[2] => greek text
)
[description] => Array
(
[0] => текст
[1] => text
[2] => greek text
)
[shop_categorie] => 1
[price] => Array
(
[0] => 12
[1] => 24
[2] => 20
)
[old_price] => Array
(
[0] => 55
[1] => 66
[2] => 65
)
[quantity] => 1
[virtual_products] =>
[in_slider] => 0
[position] => 1
[image] => image.jpg
)`
You can get another format from api response when set GET FORMAT - ?format=json/array/csv/html/jsonp/php/serialized/xml
You can add authentication when in application/config/rest.php set $config['rest_auth'] to basic/digest/session
This API is not done in order for any vendor to manage its products, it is with full access to all published products.
Congratulations to https://github.com/chriskacerguis/codeigniter-restserver 👍