ArticleService :: 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":"CriteriaLogical:http://www.proconsult.lu/WebServices100",
"Operand1":
{
"__type":"CriteriaComparison:http://www.proconsult.lu/WebServices100",
"FieldName": "Pays",
"Operator": "0",
"Value": "Belgique"
},
"Operator":0
}
}
Example:
// --------------------------------------------------------------------------------------------------------------- // Example 1 - no transmission parameter Criteria: require (__DIR__ . '/service/WebServices100.php'); use services\WebServices100; $url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/ArticleService/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(
[
'Operand1' => [
'__type' => 'CriteriaComparison:http://www.proconsult.lu/WebServices100',
'FieldName' => 'Pays',
'Operator' => '0',
'Value' => 'Belgique'],
]
);
$data = $response->getResponse();
$url = 'http://<Your ip>:<Your Port>/WebServices100/<Your environment>/ArticleService/rest/GetCount';
// Send requests to receive data
$result = WebServices100::getData($url, $data)));
$response = json_decode($result);
Result:
62