Shoptrader API docs

Image Description

Get - Manufacturer

Met deze API is het mogelijk om manufacturers uit te lezen

Parameters

Parameter Type Verplicht Omschrijving
token string Ja Token, wordt verstrekt door Shoptrader op verzoek
manufacturer_id integer Ja Manufacturer ID van het artikel
language_id integer Nee Indien leeg toon alle talen

PHP Example

<?php
ini_set
('max_execution_time'0);

$strApiBaseUrl 'uwdomeinnaam.uwdomeinextentie';
$strOutput 'array'// default array
$strUrl 'http://' $strApiBaseUrl '/Api/Get/Manufacturer/?' $strOutput;        

// standaard parameters
$arrParams = array();
$arrParams['token']         = '8f00f89310945a0ca35666c8c9ced2e314e37aa6c32e900932e19902b42208767';

// custom parameters
$arrParams['manufacturer_id']     = 1;
$arrParams['language_id']         = 4;
$arrParams['limit']             = 1;

$objCurl curl_init();
curl_setopt($objCurlCURLOPT_URL$strUrl);
curl_setopt($objCurlCURLOPT_RETURNTRANSFERtrue);
curl_setopt($objCurlCURLOPT_TIMEOUT30);
curl_setopt($objCurlCURLOPT_USERAGENT'Shoptrader');
curl_setopt($objCurlCURLOPT_POSTtrue);
curl_setopt($objCurlCURLOPT_POSTFIELDShttp_build_query($arrParams));

// execute cURL, array, xml output
$strCurlData curl_exec($objCurl);
if (
$strCurlData === FALSE) {
    echo 
"cURL Error: " curl_error($objCurl);
} else {
    
print_r($strCurlData);
}

// execute cURL, array, xml output
// $strCurlData = curl_exec($objCurl);
// if ($strCurlData === FALSE) {
//    echo "cURL Error: " . curl_error($objCurl);
// } else {
//    $arrShopResult = json_decode($strCurlData, true);
//    print_r($arrShopResult);
// }
?>

Resultaat (array)

<?php
Array (
    [
manufacturers] => Array (
        [
1] => Array (
            [@
attributes] => Array (
                [
manufacturer_id] => 1
            
)
            [
manufacturers_name] => Antuoro
            
[manufacturers_url] => www.antuoro.nl
            
[manufacturers_image] => 
            [
manufacturers_image_alt] => 
            [
manufacturers_seo_url] => 
            [
inSlider] => 0
            
[sliderUrl] => 
            [
date_added] => 01-01-2016
            
[last_modified] => 02-01-2016
            
[description] => Array (
                [
dutch] => Array (
                    [
description] => Array (
                        [@
cdata] => Antuoro beschrijving
                    
)
                )
            )
            [
meta] => Array (
                [
dutch] => Array (
                    [
manufacturers_meta_title] => Antuoro
                    
[manufacturers_meta_keywords] => antuoromerk
                    
[manufacturers_meta_description] => Antuoro meta beschrijving
                
)
            )
        )
    )
)
?>