ArticleService :: GetArticle

The POST method, is used to retrieve data.

The list of necessary parameters for sending a query:

  • string reference.

Returns data as JSON, for use in PHP, you need to convert JSON in StdClass PHP (PHP function: json_decode ()).

Input parameters:

{"reference":"BRAAR10"}

Example:

require (__DIR__ . '/service/WebServices100.php');

use services\WebServices100;

$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/ArticleService/rest/GetArticle';

// add parameters
$data = new stdClass();
$data->reference = "BRAAR10";

$json_data = json_encode($data);

// Send requests to receive data
$result = WebServices100::getData($url, $json_data);

$response = json_decode($result);

Result:

stdClass Object
(
    [__type] => ArticleStandard:http://www.proconsult.lu/WebServices100
    [Reference] => BRAAR10
    [Intitule] => Bracelet, anneaux striés
    [CodeFamille] => BIJOUXARG
    [TypeArticle] => 0
    [TypeNomenclature] => 0
    [TypeSuiviStock] => 2
    [TypeEscompte] => 0
    [UnitePoids] => 0
    [PoidsNet] => 25
    [PoidsBrut] => 45
    [IdUniteVente] => 1
    [DelaiLivraison] => 0
    [Garantie] => 36
    [PrixAchat] => 276
    [PrixUnitaireNet] => 0
    [PrixVente] => 552
    [Coefficient] => 2
    [Statistique1] => Automne/Hiver
    [Statistique2] => Fantaisie
    [Statistique3] => 
    [Statistique4] => 
    [Statistique5] => 
    [EstEnSommeil] => 
    [Langue1] => Bangle
    [Langue2] => 
    [CodeEDI] => 
    [CodeBarres] => 29131006
    [Photo] => .\Multimedia\BRAAR10.jpg
    [IdCatalogue1] => 5
    [IdCatalogue2] => 6
    [IdCatalogue3] => 8
    [IdCatalogue4] => 0
    [HorsStatistique] => 
    [VenteAuDebit] => 
    [NonImpression] => 
    [Contremarque] => 
    [FacturationPoids] => 
    [FacturationForfait] => 
    [Transfere] => 
    [Publie] => 1
    [InfosLibres] => Array
        (
            [0] => stdClass Object
                (
                    [Name] => 1ère commercialisation
                    [Type] => 1
                    [Size] => 0
                    [EstCalculee] => 
                    [Value] => /Date(666997200000+0300)/
                )

            [1] => stdClass Object
                (
                    [Name] => Marque commerciale
                    [Type] => 0
                    [Size] => 35
                    [EstCalculee] => 
                    [Value] => Bijoux d'Argentières
                )

            [2] => stdClass Object
                (
                    [Name] => Objectif / Qtés vendues
                    [Type] => 3
                    [Size] => 0
                    [EstCalculee] => 
                    [Value] => 400
                )

            [3] => stdClass Object
                (
                    [Name] => Pourcentage teneur en or
                    [Type] => 3
                    [Size] => 0
                    [EstCalculee] => 
                    [Value] => 0
                )

        )

)