Hello,
I am trying to send Payload data via ION API from Mongoose to SunSystems.
I want to use this API:

And here is my FormScript where I am setting variables for InvokeIONAPIMethod call. In ProcessImport method is setup parameters form InvokeIONAPIMethod. And FirstOutput method shows API response on Form.
But it doesn't happened. It's probably crashed during InvokeIONAPIMethod call. I suppose that I don't have correctly filled up varMethodParams variable. Please can anyone help me about this?
//<Ref>Newtonsoft.Json.dll</Ref>
using System;
using System.Collections.Generic;
using Mongoose.IDO.Protocol;
using Mongoose.Scripting;
using Newtonsoft.Json;
namespace Mongoose.FormScripts
{
public class PMLedgerImport : FormScript
{
public void ProcessImport()
{
//file kterej mam nahranej pres STO LedgerImport.xml
string payload = ThisForm.Variables("inputXml").Value;
ThisForm.Variables("varSSO").Value = "1";
ThisForm.Variables("varServerID").Value = "0";
ThisForm.Variables("varAPIContext").Value = "SUN";
ThisForm.Variables("varHttpMethod").Value = "POST";
ThisForm.Variables("varMethodName").Value = "/payload-v1/api/payload/v1/request-text?payload=" + payload + "&overwritePayloadURI=true";
ThisForm.Variables("varMethodParams").Value = "------WebKitFormBoundary7MA4YWxkTrZu0gW [{"Name": "Accept","Type": "header","Value": "application/json"},{"Name": "body","Type": " +
""body","Value": {"request": {"requestReference": "TestReference","component": "Journal","method": "Import","payloadURI": " +
""storage://CAMDemo/LedgerImportPM.xml","outputURI": "storage://CAMDemo/Responses/ResultPM.xml","uniqueOutputURI": true,"errorOutputURI": " +
""storage://CAMDemo/Responses/ErrorPM.json","uniqueErrorOutputURI": true}}, "application/json"}] ------WebKitFormBoundary7MA4YWxkTrZu0gW";
ThisForm.Variables("varRequestContentType").Value = "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW";
ThisForm.Variables("varTimeout").Value = "10000";
}
public void FirstOutput()
{
string out1 = ThisForm.Variables("varResponse").Value;
ThisForm.Variables("out1").Value = out1;
}
}
}