If you have api key and already create rest api. Then follow these steps to retrieve data using rest api.
For Article:- Create a page getdata.php
- put following code and run this code.
If you want to search an article by Article Id:
<?phpIf you want to search an article by Order Number:
include 'config.php';
$client->get('articles/ARTICLE_ID'); //Replace ARTICLE_ID with an article id for search
?>
<?phpIf you want to search all articles:
include 'config.php';
$client->get('articles/ORDER_NUMBER?useNumberAsId=1'); //Replace ORDER_NUMBER with an article order number for search
?>
<?phpFor Category:
include 'config.php';
$client->get('articles');
?>
If you want to search a category by category id:
<?php
include 'config.php';
$client->get('categories/CATEGORY_ID'); //Replace CATEGORY_ID with an article id for search
?>
If you want to search all categories:
<?php
include 'config.php';
$client->get('categories');
?>
- Thats it. Run this script and you will get your result.
Thank your very much for your examples.
ReplyDeleteExactly these I am missing at the shopware site.