ContactTiersService :: Update

The PUT method, is used to retrieve data.

The list of necessary parameters for sending a query:

  • ContactTiers contact

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

Input parameters:

{"contact":
    {"Id":23,
    "NumeroTiers":
    "BAGUES",
    "IdTypeContact":1,
    "IdServiceContact":1,
    "Civilite":1,
    "Nom":"dsfdsfsdf6",
    "Prenom":"Hedsmsndh323233",
    "Fonction":"Comptable",
    "Telephone":"+352 26 31 32 65",
    "Gsm":"+352 691 573 370",
    "Fax":"+352 26 31 32 51",
    "Email":"info@proconsult.lu"
    }
}

Example:

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

use services\ContactTiers;
use services\WebServices100;

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

// add parameters
$contactTiers = new ContactTiers();
$contactTiers->setId(23);
$contactTiers->setNumeroTiers('BAGUES');
$contactTiers->setIdTypeContact(1);
$contactTiers->setIdServiceContact(1);
$contactTiers->setNom('dsfdsfsdf6');
$contactTiers->setCivilite(1);
$contactTiers->setPrenom('Hedsmsndh323233');
$contactTiers->setFonction('Comptable');
$contactTiers->setTelephone('+352 26 31 32 65');
$contactTiers->setGsm('+352 691 573 370');
$contactTiers->setFax('+352 26 31 32 51');
$contactTiers->setEmail('info@proconsult.lu');

$data = $contactTiers->getResponse();
$data_json = json_encode($data);

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

$response = json_decode($result);

Result:

stdClass Object
(
    [Id] => 23
    [NumeroTiers] => BAGUES
    [IdTypeContact] => 1
    [IdServiceContact] => 1
    [Civilite] => 1
    [Nom] => dsfdsfsdf6
    [Prenom] => Hedsmsndh323233
    [Fonction] => Comptable
    [Telephone] => +352 26 31 32 65
    [Gsm] => +352 691 573 370
    [Fax] => +352 26 31 32 51
    [Email] => info@proconsult.lu
)