Page 1 of 1

Managing Multiple Objects in API Using the POST Method

Posted: Fri May 10, 2024 1:37 am
by Albert
Hello,

I've created an API using VL WEB, and I'm trying to use the POST method to insert JSON data. However, I'm facing an issue where only the first part of the JSON (the header) is being inserted. I'd like to insert the header into one file, then loop through the JSON details and insert them into another file.

Objects définition :
Image2.png
Image2.png (47.09 KiB) Viewed 100900 times
Image1.png
Image1.png (12.26 KiB) Viewed 100900 times

Code source methode POST :
codeAPI.PNG
codeAPI.PNG (169.7 KiB) Viewed 100900 times

request with POST methode :
{
"FHKZT1": "9600014",
"FHAMK5": "tt1",
"FHSWDA": 0,
"FHSTDA": 0,
"FHK1T1": "",
"FHLIB1": 0,
"FHC5MP": 0,
"FHLJB1": 0,
"FHALT1": "",
"FHHMDA": 0,
"FHAFTM": 0,
"R_MA108": [
{
"A2ISK8": "9600014",
"A2A4DA": 20140524,
"A2AQDA": 0,
"A2AWK3": "754",
"A2BQK3": "319",
"A2AFBE": 100000.00,
"A2ACPC": 0.500000,
"A2AIBE": 0
},
{
"A2ISK8": "9600014",
"A2A4DA": 20140524,
"A2AQDA": 0,
"A2AWK3": "754",
"A2BQK3": "320",
"A2AFBE": 100000.00,
"A2ACPC": 0.500000,
"A2AIBE": 0
},
{
"A2ISK8": "9600014",
"A2A4DA": 20140524,
"A2AQDA": 0,
"A2AWK3": "754",
"A2BQK3": "323",
"A2AFBE": 50000.00,
"A2ACPC": 0.500000,
"A2AIBE": 0
}
]
}

Could you please help me understand how to achieve this with VL WEB ?

Thank you in advance for your assistance.

Best regards,