Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Make by tools (01.00.01) - action=clean_corrupted_html
Scroll Ignore
scroll-viewporttrue
scroll-pdftrue
scroll-officetrue
scroll-chmtrue
scroll-docbooktrue
scroll-eclipsehelptrue
scroll-epubtrue
scroll-htmlfalse
Panel
titleSommaire

Table of Contents
stylenone

Concept

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

Info

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

Code Block
languagetext
themeEmacs
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 :

Code Block
languagebash
themeRDark
{
  "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

JSON invalide

Code Block
languagetext
themeEmacs
curl -s -S -U 'username:password' -X POST \
-H 'Content-Type: application/json' -d '[]' \
 "http://webui:7767/external-api/service-weather/v1/create"
Code Block
languagebash
themeRDark
{
  "output": "Invalid JSON"
}

Paramètre inconnu

Code Block
languagetext
themeEmacs
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"
Code Block
languagebash
themeRDark
{
  "output": "Invalid field name [ unknown_key ]"
}

Excerpt Include
V1 - Les erreurs communes lors de l'envoi de la requête à /external-api/service-weather/v1
V1 - Les erreurs communes lors de l'envoi de la requête à /external-api/service-weather/v1
nopaneltrue