ContactTiersService :: GetCount

The POST method, is used to retrieve data.

The list of parameters is not mandatory to request:

  • Criteria Criteria.

Returns count Contacts.

Input parameters:

{  "criteria":
  {
      "__type":"CriteriaComparison:http://www.proconsult.lu/WebServices100",
      "FieldName":"NumeroTiers",
      "Operator":5,
      "Value":"NUM0007"
  }
}

Example:

// ---------------------------------------------------------------------------------------------------------------
// Example 1 - no transmission parameter Criteria:
require (__DIR__ . '/service/WebServices100.php'); 

use services\WebServices100;

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

// Send requests
$result = WebServices100::getData($url)));

$countContact = json_decode($result); 
// ---------------------------------------------------------------------------------------------------------------
// EXAMPLE 2 - with the transmission parameter Criteria:
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('Pays');
$response->setOperator("0");
$response->setValue("Belgique");
$response->setOperand(
    [
        '__type' => 'CriteriaComparison:http://www.proconsult.lu/WebServices100',
        'FieldName' => 'NumeroTiers',
        'Operator' => '0',
        'Value' => 'BAGUES'
    ]
); 

$data = $response->getResponse(); 

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

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

$response = json_decode($result);

Result:

4885