Concept

Méthode POST permettant de créer une nouvelle vue météo.

La vue créée sera forcément vide à sa création ( widget Titre uniquement ).

Les paramètres

Les paramètres doivent être envoyées au format JSON dans le corps de la requête.

Nom et formatValeur par défautDescription

"weather_name": "Ma vue météo"

---

Nom de la vue météo. 

Réponse

Codes de retour

Codes de retourExplications
200

OK

400

Paramètre invalide

401

L'accès nécessite une authentification ou un Token valide.

403

Authentification de l'utilisateur OK, mais droits non suffisants.

500

L'appel est valide, mais un problème d'exécution est rencontré.

Retour du code 200

curl -s -S -U 'username:password' -X POST \
-H 'Content-Type: application/json' -d '{"weather_name": "Ma vue météo"}' \
 "http://webui:7767/external-api/service-weather/v1/create"


Exemple de sortie attendue :

{
  "output": {
    "view_info": {
      "name": "Ma vue météo",
      "state": "draft",
      "type": "service_weather",
      "weather_uuid": "4bdd306edbad4f6dbc10db2fcc7662a4",
      "weather_version": 1,
      "weather_format_version": 5,
      "weather_shared_group": "service_weather",
      "weather_creation_time": 1787820376.9576776
    }
  }
}

Retour du code 400


Paramètres POST incorrects

JSON invalide
curl -s -S -U 'username:password' -X POST \
-H 'Content-Type: application/json' -d '[]' \
 "http://webui:7767/external-api/service-weather/v1/create"
{
  "output": "Invalid JSON"
}
Paramètre inconnu
curl -s -S -U 'username:password' -X POST \
-H 'Content-Type: application/json' -d '{"unknown_key": "value"}' \
 "http://webui:7767/external-api/service-weather/v1/create"
{
  "output": "Invalid field name [ unknown_key ]"
}