- 6 Minutes à lire
- Imprimer
- SombreClair
- PDF
Annexe oData
- 6 Minutes à lire
- Imprimer
- SombreClair
- PDF
Format des données attendu
Type énumération
Les valeurs des attributs de type énumération doivent être transmis avec leur valeur numérique formatée en chaîne:
Dans un payload Json
{
“Gender”: “2”
}
Avec l’option $filter :
$filter eq '2'
Type Date et heure
Toutes les propriétés de type Date et heure doivent être transmises en UTC.
Le format attendu est le suivant : YYYY-MM-DDTHH:mm:ssZ
Exemple de valeur :
2024-06-26T07:46:49Z
Il est possible de ne passer que la date sans l’heure.
Exemple de valeur :
2024-06-26
Type Fuseau Horaire (TimeZoneId)
Fuseau Horaire | Valeur à utiliser pour les appels oData (TimeZoneId) |
---|---|
(UTC-12:00) International Date Line West | Dateline Standard Time |
(UTC-11:00) Coordinated Universal Time-11 | UTC-11 |
(UTC-10:00) Aleutian Islands | Aleutian Standard Time |
(UTC-10:00) Hawaii | Hawaiian Standard Time |
(UTC-09:30) Marquesas Islands | Marquesas Standard Time |
(UTC-09:00) Alaska | Alaskan Standard Time |
(UTC-09:00) Coordinated Universal Time-09 | UTC-09 |
(UTC-08:00) Baja California | Pacific Standard Time (Mexico) |
(UTC-08:00) Coordinated Universal Time-08 | UTC-08 |
(UTC-08:00) Pacific Time (US & Canada) | Pacific Standard Time |
(UTC-07:00) Arizona | US Mountain Standard Time |
(UTC-07:00) Chihuahua, La Paz, Mazatlan | Mountain Standard Time (Mexico) |
(UTC-07:00) Mountain Time (US & Canada) | Mountain Standard Time |
(UTC-06:00) Central America | Central America Standard Time |
(UTC-06:00) Central Time (US & Canada) | Central Standard Time |
(UTC-06:00) Easter Island | Easter Island Standard Time |
(UTC-06:00) Guadalajara, Mexico City, Monterrey | Central Standard Time (Mexico) |
(UTC-06:00) Saskatchewan | Canada Central Standard Time |
(UTC-05:00) Bogota, Lima, Quito, Rio Branco | SA Pacific Standard Time |
(UTC-05:00) Chetumal | Eastern Standard Time (Mexico) |
(UTC-05:00) Eastern Time (US & Canada) | Eastern Standard Time |
(UTC-05:00) Haiti | Haiti Standard Time |
(UTC-05:00) Havana | Cuba Standard Time |
(UTC-05:00) Indiana (East) | US Eastern Standard Time |
(UTC-05:00) Turks and Caicos | Turks And Caicos Standard Time |
(UTC-04:00) Asuncion | Paraguay Standard Time |
(UTC-04:00) Atlantic Time (Canada) | Atlantic Standard Time |
(UTC-04:00) Caracas | Venezuela Standard Time |
(UTC-04:00) Cuiaba | Central Brazilian Standard Time |
(UTC-04:00) Georgetown, La Paz, Manaus, San Juan | SA Western Standard Time |
(UTC-04:00) Santiago | Pacific SA Standard Time |
(UTC-03:30) Newfoundland | Newfoundland Standard Time |
(UTC-03:00) Araguaina | Tocantins Standard Time |
(UTC-03:00) Brasilia | E. South America Standard Time |
(UTC-03:00) Cayenne, Fortaleza | SA Eastern Standard Time |
(UTC-03:00) City of Buenos Aires | Argentina Standard Time |
(UTC-03:00) Greenland | Greenland Standard Time |
(UTC-03:00) Montevideo | Montevideo Standard Time |
(UTC-03:00) Punta Arenas | Magallanes Standard Time |
(UTC-03:00) Saint Pierre and Miquelon | Saint Pierre Standard Time |
(UTC-03:00) Salvador | Bahia Standard Time |
(UTC-02:00) Coordinated Universal Time-02 | UTC-02 |
(UTC-01:00) Azores | Azores Standard Time |
(UTC-01:00) Cabo Verde Is. | Cape Verde Standard Time |
(UTC) Coordinated Universal Time | UTC |
(UTC+00:00) Dublin, Edinburgh, Lisbon, London | GMT Standard Time |
(UTC+00:00) Monrovia, Reykjavik | Greenwich Standard Time |
(UTC+00:00) Sao Tome | Sao Tome Standard Time |
(UTC+01:00) Casablanca | Morocco Standard Time |
(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna | W. Europe Standard Time |
(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague | Central Europe Standard Time |
(UTC+01:00) Brussels, Copenhagen, Madrid, Paris | Romance Standard Time |
(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb | Central European Standard Time |
(UTC+01:00) West Central Africa | W. Central Africa Standard Time |
(UTC+02:00) Amman | Jordan Standard Time |
(UTC+02:00) Athens, Bucharest | GTB Standard Time |
(UTC+02:00) Beirut | Middle East Standard Time |
(UTC+02:00) Cairo | Egypt Standard Time |
(UTC+02:00) Chisinau | E. Europe Standard Time |
(UTC+02:00) Damascus | Syria Standard Time |
(UTC+02:00) Gaza, Hebron | West Bank Standard Time |
(UTC+02:00) Harare, Pretoria | South Africa Standard Time |
(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius | FLE Standard Time |
(UTC+02:00) Jerusalem | Israel Standard Time |
(UTC+02:00) Kaliningrad | Kaliningrad Standard Time |
(UTC+02:00) Khartoum | Sudan Standard Time |
(UTC+02:00) Tripoli | Libya Standard Time |
(UTC+02:00) Windhoek | Namibia Standard Time |
(UTC+03:00) Baghdad | Arabic Standard Time |
(UTC+03:00) Istanbul | Turkey Standard Time |
(UTC+03:00) Kuwait, Riyadh | Arab Standard Time |
(UTC+03:00) Minsk | Belarus Standard Time |
(UTC+03:00) Moscow, St. Petersburg | Russian Standard Time |
(UTC+03:00) Nairobi | E. Africa Standard Time |
(UTC+03:30) Tehran | Iran Standard Time |
(UTC+04:00) Abu Dhabi, Muscat | Arabian Standard Time |
(UTC+04:00) Astrakhan, Ulyanovsk | Astrakhan Standard Time |
(UTC+04:00) Baku | Azerbaijan Standard Time |
(UTC+04:00) Izhevsk, Samara | Russia Time Zone 3 |
(UTC+04:00) Port Louis | Mauritius Standard Time |
(UTC+04:00) Saratov | Saratov Standard Time |
(UTC+04:00) Tbilisi | Georgian Standard Time |
(UTC+04:00) Volgograd | Volgograd Standard Time |
(UTC+04:00) Yerevan | Caucasus Standard Time |
(UTC+04:30) Kabul | Afghanistan Standard Time |
(UTC+05:00) Ashgabat, Tashkent | West Asia Standard Time |
(UTC+05:00) Ekaterinburg | Ekaterinburg Standard Time |
(UTC+05:00) Islamabad, Karachi | Pakistan Standard Time |
(UTC+05:00) Qyzylorda | Qyzylorda Standard Time |
(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi | India Standard Time |
(UTC+05:30) Sri Jayawardenepura | Sri Lanka Standard Time |
(UTC+05:45) Kathmandu | Nepal Standard Time |
(UTC+06:00) Astana | Central Asia Standard Time |
(UTC+06:00) Dhaka | Bangladesh Standard Time |
(UTC+06:00) Omsk | Omsk Standard Time |
(UTC+06:30) Yangon (Rangoon) | Myanmar Standard Time |
(UTC+07:00) Bangkok, Hanoi, Jakarta | SE Asia Standard Time |
(UTC+07:00) Barnaul, Gorno-Altaysk | Altai Standard Time |
(UTC+07:00) Hovd | W. Mongolia Standard Time |
(UTC+07:00) Krasnoyarsk | North Asia Standard Time |
(UTC+07:00) Novosibirsk | N. Central Asia Standard Time |
(UTC+07:00) Tomsk | Tomsk Standard Time |
(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi | China Standard Time |
(UTC+08:00) Irkutsk | North Asia East Standard Time |
(UTC+08:00) Kuala Lumpur, Singapore | Singapore Standard Time |
(UTC+08:00) Perth | W. Australia Standard Time |
(UTC+08:00) Taipei | Taipei Standard Time |
(UTC+08:00) Ulaanbaatar | Ulaanbaatar Standard Time |
(UTC+08:45) Eucla | Aus Central W. Standard Time |
(UTC+09:00) Chita | Transbaikal Standard Time |
(UTC+09:00) Osaka, Sapporo, Tokyo | Tokyo Standard Time |
(UTC+09:00) Pyongyang | North Korea Standard Time |
(UTC+09:00) Seoul | Korea Standard Time |
(UTC+09:00) Yakutsk | Yakutsk Standard Time |
(UTC+09:30) Adelaide | Cen. Australia Standard Time |
(UTC+09:30) Darwin | AUS Central Standard Time |
(UTC+10:00) Brisbane | E. Australia Standard Time |
(UTC+10:00) Canberra, Melbourne, Sydney | AUS Eastern Standard Time |
(UTC+10:00) Guam, Port Moresby | West Pacific Standard Time |
(UTC+10:00) Hobart | Tasmania Standard Time |
(UTC+10:00) Vladivostok | Vladivostok Standard Time |
(UTC+10:30) Lord Howe Island | Lord Howe Standard Time |
(UTC+11:00) Bougainville Island | Bougainville Standard Time |
(UTC+11:00) Chokurdakh | Russia Time Zone 10 |
(UTC+11:00) Magadan | Magadan Standard Time |
(UTC+11:00) Norfolk Island | Norfolk Standard Time |
(UTC+11:00) Sakhalin | Sakhalin Standard Time |
(UTC+11:00) Solomon Is., New Caledonia | Central Pacific Standard Time |
(UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky | Russia Time Zone 11 |
(UTC+12:00) Auckland, Wellington | New Zealand Standard Time |
(UTC+12:00) Coordinated Universal Time+12 | UTC+12 |
(UTC+12:00) Fiji | Fiji Standard Time |
(UTC+12:45) Chatham Islands | Chatham Islands Standard Time |
(UTC+13:00) Coordinated Universal Time+13 | UTC+13 |
(UTC+13:00) Nuku’alofa | Tonga Standard Time |
(UTC+13:00) Samoa | Samoa Standard Time |
(UTC+14:00) Kiritimati Island | Line Islands Standard Time |
Types complexes - Duration
Propriété | Type | Description |
Length | Numérique | Longueur du temps |
Scale | Énumération | Indicateur de la longueur du temps Valeur possible : Milliseconds=1 Seconds=2 Minute=3 Hours=4 Days=5 Weeks=6 Months=7 Years=8 |
La syntaxe est :
"MaPropriété": { "Length":1.00, "Scale":"Days"}
Codes retours http
Succès
Code | Text | Description |
200 | OK | Tâche réalisée |
201 | Created | Création réussie |
204 | No Content | Le serveur a reçu la requête mais il n'y a pas d'information à renvoyer |
Erreur
Code | Text | Description |
400 | Bad Request | La requête est invalide. Un message d'accompagnement est souvent présent pour expliquer la raison. |
401 | Invalid username or password | l'authentification a échoué car le couple [login, mot de passe] n'est pas reconnu |
401 | Unauthorized | La requête est comprise mais elle a été refusée ou bien les droits sont insuffisants ou le mode d’authentification « Basic » n’est pas activé sur le serveur IIS |
404 | Not Found | L'URL demandée est invalide ou la ressource demandée n'existe pas |
500 | Internal Server | Vérifier la casse de l’entité dans l’URL. |
Pour les erreurs avec le code 400, vérifiez la syntaxe du fichier JSON :
Les valeurs des propriétés de type « Énumération » doivent être entourées de guillemets. Exemple : « Gender » : « 1 »
Les valeurs des propriétés de type « Numérique » ne doivent pas être entourées par des guillemets. Exemple : « Id » : 1000
Opération de liaison entre objets
Ajouter d’une entité dans une propriété de navigation de type « collection d’entités »
On appelle propriété de navigation une relation entre 2 entités.
Une requête POST demande à une entité existante de compléter sa propriété de navigation avec une nouvelle référence
Par exemple le user 327680 se voit attribuer un nouveau domaine de gestion ayant l'identifiant 163849
Les types de réponses possibles :
204 No Content : OK
400 Bad Request : Erreur technique ou fonctionnelle
401 xxxxxxxxx : Erreur de sécurité (voir chapitre Sécurité et authentification)
404 NotFound : Enregistrement inexistant (pour l'entité principale ou secondaire)
500 Internal Server : Vérifier la casse de l’entité dans l’URL
Retirer une entité dans une propriété de navigation de type « collection d’entités »
Une requête DELETE demande à une entité existante de retirer un élément de sa propriété de navigation de type collection d’entités
L’utilisateur 327680 se voit retiré le domaine de gestion ayant l'identifiant 163849
Les types de réponses possibles :
204 No Content : OK
400 Bad Request : Erreur technique ou fonctionnelle
404 NotFound : Enregistrement inexistant (pour l'entité principale ou secondaire)
500 Internal Server : Vérifier la casse de l’entité dans l’URL
Affecter ou remplacer une entité dans une propriété de navigation de type « entité »
Une requête PUT ou POST demande à une entité existante de changer la référence de sa propriété de navigation de type « entité »
Par exemple la formation 123 se voit attribuer un responsable pédagogique qui n'est autre que l'utilisateur ayant l'identifiant 1234.
Les types de réponses possibles :
204 No Content : OK
400 Bad Request : Erreur technique ou fonctionnelle
401 xxxxxxxxx : Erreur de sécurité (voir chapitre Sécurité et authentification)
404 NotFound : Enregistrement inexistant (pour l'entité principale ou secondaire)
500 Internal Server : Vérifier la casse de l’entité dans l’URL
Retirer une entité dans une propriété de navigation de type « entité »
Une requête DELETE demande à une entité existante de retirer la référence de sa propriété de navigation de type « entité ».
Par exemple, la requête suivante casse le lien entre la formation 123 et le responsable pédagogique ayant pour id 1234. À l'issue du traitement, la formation se retrouve sans affectation de responsable pédagogique.
Les types de réponses possibles :
204 No Content : OK
400 Bad Request : Erreur technique ou fonctionnelle
401 xxxxxxxxx : Erreur de sécurité (voir chapitre Sécurité et authentification)
404 NotFound : Enregistrement inexistant (pour l'entité principale ou secondaire)
500 Internal Server : Vérifier la casse de l’entité dans l’URL
Spécification du Domaine de gestion
Spécifier le domaine de gestion de l’entité lors de la création
En activant le paramètre de configuration OData : possibilité de spécifier le domaine de gestion d'une entité.
Vous avez la possibilité de spécifier via une requête POST le PrimaryDomain de l’entité créée vis son Id ou son ExternalId :
Lors du traitement de la requête, le domaine de gestion est, s’il est trouvé, enregistré sur la formation par exemple.
Il est possible de spécifier le domaine de gestion lors de la création d’une session de formation ou d’évaluation (en spécifiant dans le body de la requête le PrimaryDomain comme dans la capture d’écran ci-dessus).
Le UserApi utilisé peut spécifier un domaine seulement s’il a accès à ce domaine (son domaine ou un de ses sous-domaines).