Suppression d’un profil d’un contact à une zone hydro¶
Associée à la méthode DELETE, cette route permet de supprimer un profil d’un contact sur une zone hydro.
Paramètres HTTP¶
Paramètre |
Valeur |
|---|---|
Route |
contactzonehydro |
Méthode |
DELETE |
Droit de gestion¶
Pour supprimer un profil d’un contact, il faut être gestionnaire de la zone hydro.
Contenu de la requête HTTP¶
La requête HTTP doit contenir un json hydrométrie contenant un profil d’un contact sur une zone hydro.
Json hydrométrie¶
Format JSON¶
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://phyc.org/ws/ajouterContact.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"]
},
"Contacts": {
"type": "array",
"items": {
"type": "object",
"properties": {
"CdContact": {"type": "string"},
"ProfilsAdminLocal": {
"type": "array",
"items": {
"type": "object",
"properties": {
"CdProfilAdminLocal": {"type": "string"},
"ZonesHydro": {
"type": "array",
"items": {
"type": "object",
"properties": {
"CdZoneHydro": {"type": "string"}
},
"required": ["CdZoneHydro"],
"additionalProperties": false
},
"minItems": 1
}
},
"required": ["CdProfilAdminLocal", "ZonesHydro"],
"additionalProperties": false
},
"minItems": 1
}
},
"required": ["CdContact"],
"additionalProperties": false
},
"minItems": 1
}
},
"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 les attributs CdIntervenant et Contacts;
L’attribut Contacts doit être une liste non vide d’objets Contact;
L’objet Contact doit contenir uniquement les attributs CdContact et ProfilsAdminLocal.
ProfilsAdminLocal doit être une liste non vide d’objets ProfilAdminLocal;
L’objet ProfilAdminLocal doit obligatoiremnt contenir les attributs CdProfilAdminLocal et ZonesHydro.
ZonesHydro doit être une liste d’objet ZoneHydro contenant un unique attribut CdZoneHydro.
Réponse du web-service¶
En cas de succès, le web-service retournera un json hydrométrie contenant le profil du contact désactivé.
Le web-service rajoutera l” attribut DtDesactivationProfilAdminLocal au profil du contact.