ContactTiersService :: GetList

The POST method, is used to retrieve data.

The list of parameters is not mandatory to request:

  • Criteria criteria,
  • array orders,
  • int pageNumber,
  • int rowsPerPage.

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

Input parameters:

  • Criteria
{"criteria":
  {
      "__type":"CriteriaComparison:http://www.proconsult.lu/WebServices100",
      "FieldName":"NumeroTiers",
      "Operator":5,
      "Value":"NUM0007"
  }
}
  • orders
{"orders":[{"NumeroTiers":"Asc"}]}
  • pageNumber
{pageNumber: 1}
  • rowsPerPage
{rowsPerPage: 10}

Example:

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

use services\WebServices100;
use services\Criteria;

// add parameters
$response = new Criteria();
$response->setType('CriteriaLogical:http://www.proconsult.lu/WebServices100');
$response->setFieldName('NumeroTiers');
$response->setOperator("0");
$response->setValue("BAGUES");
$response->setOperand(
  [
    'Operand1' => [
    '__type' => 'CriteriaComparison:http://www.proconsult.lu/WebServices100',
    'FieldName' => 'Pays',
    'Operator' => '0',
    'Value' => 'BAGUES']
    ]
);
$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/ContactTiersService/rest/GetList';
$data = $response->getResponse();

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

$response = json_decode($result);

Result:

Array
(
    [0] => stdClass Object
        (
            [Id] => 1
            [NumeroTiers] => BAGUES
            [IdTypeContact] => 1
            [IdServiceContact] => 3
            [Civilite] => 0
            [Nom] => ZHIA
            [Prenom] => Estéban
            [Fonction] => Comptable
            [Telephone] => 03 87 23 11 45
            [Gsm] => 06 80 25 45 33
            [Fax] => 
            [Email] => zhia@bagues.fr
            [Createur] => MA30
            [DateModification] => /Date(1537438980000+0200)/
        )
    [N] => stdClass Object
        (
            [Id] => N
            [NumeroTiers] => BILLO
            [IdTypeContact] => 1
            [IdServiceContact] => 3
            [Civilite] => 1
            [Nom] => LASARUS
            [Prenom] => Sarah
            [Fonction] => Adjoint comptabilité
            [Telephone] => 03 54 54 44 65
            [Gsm] => 06 01 55 88 66
            [Fax] => 
            [Email] => 
            [Createur] => MA30
            [DateModification] => /Date(1537438980000+0200)/
        )
)