Ajout d’un intervenant

Ce web-service permet d’ajouter des intervenants en PHyC.

Paramètres HTTP

Paramètre

Valeur

Route

intervenant

Méthode

POST

Contenu

intervenant au format json

Droit de gestion

Il faut être administrateur national pour ajouter un intervenant.

Règle technique

Le code de l’intervenant ne doit pas être déjà présent en PHyC

L’attribut schemeAgencyId ne peut prendre qu’une des valeurs : SIRET ou SANDRE.

Contenu de la requête HTTP

La requête HTTP doit contenir un json hydrométrie contenant un intervenant.

Json hydrométrie

Schéma de validation
{
    "$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"},
                            "MnIntervenant": {"type": "string"},
                            "BpIntervenant": {"type": "string"},
                            "ImmoIntervenant": {"type": "string"},
                            "RueIntervenant": {"type": "string"},
                            "LieuIntervenant": {"type": "string"},
                            "VilleIntervenant": {"type": "string"},
                            "DepIntervenant": {"type": "string"},
                            "CommentairesIntervenant": {"type": "string"},
                            "ActivitesIntervenant": {"type": "string"},
                            "CPIntervenant": {"type": "string"},
                            "NomInternationalIntervenant": {"type": "string"},
                            "CdSIRETRattacheIntervenant": {"type": "string"},
                            "Commune": {
                                "type":"object",
                                "properties": {
                                    "CdCommune": {"type": "string"}
                                },
                                "required": ["CdCommune"],
                                "additionalProperties": false
                            },
                            "PaysComplementIntervenant": {"type": "string"},
                            "AdEtrangereComplementIntervenant": {"type": "string"},
                            "TelephoneComplementIntervenant": {"type": "string"},
                            "FaxComplementIntervenant": {"type": "string"},
                            "SiteWebComplementIntervenant": {"type": "string"}
                        },
                        "required": ["CdIntervenant", "schemeAgencyID", "NomIntervenant", "StIntervenant"],
                        "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 schemeAgencyID;

  • L’objet Intervenant ne doit pas contenir les attributs Contacts, DateCreationIntervenant et DateMajIntervenant.

Réponse du web-service

En cas de succès, le web-service retournera un json hydrométrie contenant l’intervenant ajouté.

Le web-service rajoutera les attributs suivants à l’intervenant:

  • DateCreationIntervenant : date de création

  • DateMajIntervenant : date de mise en base