PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV (précédentes versions) → Help pour appel API REST en WD25
Help pour appel API REST en WD25
Débuté par titou44, 09 nov. 2022 10:12 - Aucune réponse
Posté le 09 novembre 2022 - 10:12
bonjour

je suis en Windev 25.

Un client nous demande nous interfacer à son SI via une API REST. il s'est contenté de nous donner les JSON d'entrée. et là je coince car je n'ai jamais eu à faire ce genre d'appel. je patine depuis 2 jours. voici le JSON fourni :

{
"info": {
"_postman_id": "edc333f8-7c89-4d5a-b923-76bba9d2bb2f",
"name": "lereferentiel",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Trainings Catalog",
"protocolProfileBehavior": {
"disableBodyPruning": true
},
"request": {
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "Replace with the API you use to authenticate against the App",
"type": "string"
},
{
"key": "key",
"value": "x-appli-api-key",
"type": "string"
}
]
},
"method": "GET",
"header": [],
"body": {
"mode": "raw",
"raw": "",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "https://recette.ledomaine.fr/externes/leservice/modeles",
"protocol": "https",
"host": [
"recette",
"ledomaine",
"fr"
],
"path": [
"externes",
"leservice",
"modeles"
]
}
},
"response": []
}
],
"auth": {
"type": "apikey",
"apikey": [
{
"key": "value",
"value": "eyJhbGciOiJIUzUxM-rk1Lj9h98Qw8sm9o3rRUi3IscQ",
"type": "string"
},
{
"key": "key",
"value": "x-appli-api-key",
"type": "string"
},
{
"key": "in",
"value": "header",
"type": "string"
}
]
},
"event": [
{
"listen": "prerequest",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
},
{
"listen": "test",
"script": {
"type": "text/javascript",
"exec": [
""
]
}
}
]
}

je suis preneur d'un bout de code adapté à la demande.
merci par avance pour toute aide
titou