View Full Version : new here - a couple of questions
Hi all, I'm new here and have a couple of questions...
Is it possible to retrieve a list of all categories (that contain products) for a specific merchant?
Is it possible to retrieve a list of products in a specific category for a specific merchant?
If so, which SOAP requests would I use?
ade.
I guess the silence means "no not possible" :(
Hi all, I'm new here and have a couple of questions...
Is it possible to retrieve a list of all categories (that contain products) for a specific merchant?
Is it possible to retrieve a list of products in a specific category for a specific merchant?
If so, which SOAP requests would I use?
ade.
Hi Ade
To answer your questions
1) No, it is not possible to retrieve a list of all the categories that a merchant promotes via the API (unless you promote just one merchant). The getCategoryTree() function allows you to view a tree based on all the merchants you promote and there is not an option available to restrict this down. But as I said, if as an affiliate you just promoted one merchant, then technically you would get the tree for just one merchant.
2) Yes this is possible. You would need to call the GetProductList() function and pass two refinebys as options. The first would be the merchant refine with ID of the merchant present. The second would be the category refine which restricts down the category.
I would suggest taking a look at our example software available via the interface for more information and there is also some good information on the wiki (log into your darwin account and click 'Wiki' on the top right).
Cheers
Ollie
2) Yes this is possible. You would need to call the GetProductList() function and pass two refinebys as options. The first would be the merchant refine with ID of the merchant present. The second would be the category refine which restricts down the category.
Hi Ader42,
As Ollie suggested for question 2, this code might help you. To refine by category too, just use another refineBy.
define('API', 'PS');
require_once('constants.inc.php');
require_once('includes/classes/class.ClientFactory.php');
$oClient = ClientFactory::getClient();
// Example refine by structure
// Refine by Merchant (3)
$oRefineBy = new stdClass();
$oRefineBy->iId = 3;
$oRefineBy->sName = '';
// Refine by merchant 1599
$oRefineByDefinition = new stdClass();
$oRefineByDefinition->sId = 2549;
$oRefineByDefinition->sName = '';
$oRefineBy->oRefineByDefinition = $oRefineByDefinition;
// Columns to return
$returnedcolumns = array(sAwImageUrl,sDescription,sBrand,iMerchantId, iCategoryId);
$aParams = array("sQuery" => "Kings Of Leon Only By The Night", "bAdult" => false, "iLimit" => 40, "sColumnToReturn" => $returnedcolumns, "oActiveRefineByGroup" => $oRefineBy);
$oResponse= $oClient->call('getProductList', $aParams);
foreach($oResponse->oProduct as $details) {
echo '<p><img src="'.$details->sAwThumbUrl.'" /> <a href="'.$details->sAwDeepLink.'">'.$details->sName.'</a> - '.sprintf("%.2f",$details->fPrice).'</p>';
}
Hope this helps,
Simon