Modification d’un intervenant¶
Associée à la méthode PUT, cette route permet de modifier des intervenants en PHyC.
Paramètres HTTP¶
Paramètre |
Valeur |
|---|---|
Route |
intervenant |
Méthode |
PUT |
Contenu |
intervenant au format json |
Droit de gestion¶
Il faut être gestionnaire d’une zone hydro pour modifier un intervenant.
Contenu de la requête HTTP¶
La requête HTTP doit contenir un json hydrométrie contenant un intervenant.
Json hydrométrie¶
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://phyc.org/ws/ajouterIntervenant.json",
"type": "object",
"properties": {
"Scenario": {
"type": "object"
},
"RefHyd": {
"type": "object",
"properties": {
"Intervenants": {
"type": "array",
"items": {
"type": "object",
"properties": {
"CdIntervenant": {"type": "string"},
"schemeAgencyID": {
"type": "string",
"enum": ["SANDRE", "SIRET"]
},
"NomIntervenant": {"type": "string"},
"StIntervenant": {
"type": "integer",
"enum": [1, 2, 3, 4, 5, 6]
},
"AuteurIntervenant": {"type": ["string", "null"]},
"MnIntervenant": {"type": ["string", "null"]},
"BpIntervenant": {"type": ["string", "null"]},
"ImmoIntervenant": {"type": ["string", "null"]},
"RueIntervenant": {"type": ["string", "null"]},
"LieuIntervenant": {"type": ["string", "null"]},
"VilleIntervenant": {"type": ["string", "null"]},
"DepIntervenant": {"type": ["string", "null"]},
"CommentairesIntervenant": {"type": ["string", "null"]},
"ActivitesIntervenant": {"type": ["string", "null"]},
"CPIntervenant": {"type": ["string", "null"]},
"NomInternationalIntervenant": {"type": ["string", "null"]},
"CdSIRETRattacheIntervenant": {"type": ["string", "null"]},
"Commune": {
"type":["object", "null"],
"properties": {
"CdCommune": {"type": "string"}
}
},
"PaysComplementIntervenant": {"type": ["string", "null"]},
"AdEtrangereComplementIntervenant": {"type": ["string", "null"]},
"TelephoneComplementIntervenant": {"type": ["string", "null"]},
"FaxComplementIntervenant": {"type": ["string", "null"]},
"SiteWebComplementIntervenant": {"type": ["string", "null"]}
},
"required": ["CdIntervenant"],
"additionalProperties": false
},
"minItems": 1,
"maxItems": 1
}
},
"required": ["Intervenants"],
"additionalProperties": false
}
},
"required": ["Scenario", "RefHyd"],
"additionalProperties": false
}
Les attributs RefHyd (associé à l’objet Refhyd) et Scenario sont obligatoires;
L’objet RefHyd ne doit contenir qu’un seul attribut Intervenants associé à une liste ne contenant qu’un seul objet Intervenant;
L’objet Intervenant doit contenir obligatoirement l’attribut CdIntervenant.
L’objet Intervenant ne doit pas contenir les attributs Contacts, DateCreationIntervenant et DateMajIntervenant.
Réponse du web-service¶
Le web-service retournera l’intervenant au format json hydrométrie en rajoutant l’attribut DateMajIntervenant.