How to send body request template in Kony Visualizer?

This thread was migrated from an old forum. It may contain information that are no longer valid. For further assistance, please post a new question or open a support ticket from the Customer Support portal.

I have an API that accepts a request template. How do I pass this json in Kony Visualizer as part of the input parameters?

Hi @Thomvs White​ ,

You have to configure the request template in mobile fabric and pass the required input parameters from js code. Replace the values in request template with $inputparamvar

Check below link for more info :

http://docs.kony.com/konylibrary/konyfabric/kony_fabric_quickstart_guide/Default.htm#Creating_an_Integration_Service.htm%3FTocPath%3D_____7

Is there another way? The json object has hundreds of attributes.

{"Site":{"Id":2304,"Name":"(NOJV) Bare Operational Center"},"AssessmentCategory":"Field Verification","CreatedBy":{"UserId":2132405,"UserName":"KZKA","LastName":"Wessolowski","FirstName":"Joaquin","SiteName":"Madero Office - non U&G"},"LastUpdatedBy":null,"LastUpdateDateUTC":"0001-01-01T00:00:00","CreatedDateUTC":"2018-04-05T07:03:55","UdfFields":{"LEVERAGEINPROGRESS":{"$type":"integer?","Value":0},"engagementdt":{"$type":"datetime?","Value":"2018-04-05T07:03:55.3451572Z"},"wkcrewsubofprimid":{"$type":"nameditem","Value":{"Id":2,"Name":"No"}},"TRANSLATIONSTATUSID":{"$type":"nameditem","Value":{"Id":1,"Name":"No Translation Required"}},"udf-msw-fv-eng-sectionc-jsa-1":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-jsa-2":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-jsa-3":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-jsa-4":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-jsa-5":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-jsa-6":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-jsa-7":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-jsa-8":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-jsa-9":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-1":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-2":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-3":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-4a":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-4b":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-5a":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-5b":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-6":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ssem-7":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-emgt-1":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-emgt-2":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ptw-1":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ptw-2":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ptw-3":{"$type":"multiselect","Value":null},"udf-msw-fv-eng-sectionc-ptw-4":{"$type":"multiselect","Value":null},"msw-fv-eng-sectionc-jsa-1-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-jsa-2-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-jsa-3-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-jsa-4-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-jsa-5-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-jsa-6-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-jsa-7-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-jsa-8-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-jsa-9-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-1-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-2-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-3-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-4a-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-4b-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-5a-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-5b-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-6-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ssem-7-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-emgt-1-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-emgt-2-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ptw-1-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ptw-2-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ptw-3-comments":{"$type":"localizednote","Values":null,"Value":null},"msw-fv-eng-sectionc-ptw-4-comments":{"$type":"localizednote","Values":null,"Value":null},"mswspecificlocation":{"$type":"localizednote","Values":null,"Value":null},"timeofdayid":{"$type":"nameditem","Value":null},"workforcetypeid":{"$type":"nameditem","Value":null},"primarycompanyid":{"$type":"lookup","Value":null},"mswsubcontractorname":{"$type":"localizednote","Values":null,"Value":null},"udf-msw-specialized-activity-flagsgroup":{"$type":"multiselect","Value":null},"mswotherspecactshortnote":{"$type":"localizednote","Values":null,"Value":null}},"AssessmentId":0,"Agency":null,"AssessmentLevel":null,"AssessmentPlannedDuration":null,"Company":null,"Occupation":null,"Location":null,"Task":null,"WeatherCondition":null,"InvolvementType":null,"NoticeType":null,"Domain":null,"Shift":null,"Reason":null,"Method":null,"RouteType":null,"DriveType":null,"VehicleType":null,"Temperature":null,"Flags":[],"ResponsibilityAssignments":{"89":[{"Id":2132405,"Name":"Wessolowski, Joaquin"}], "500":[{"Id":2132405,"Name":"Wessolowski, Joaquin"}]},"Department":{"Id":120539,"Name":"LABU:Venezuela ET BOC PPTE O&M"},"AssessmentType":{"Id":140,"Name":"Field Verification"},"WorkflowStatus":{"Id":1,"Name":"Open"},"PlannedRemovalDateUTC":null,"ConductedDateUTC":"2018-04-05T07:03:55.3451572Z","ReportedDateUTC":"2018-04-05T07:03:55.3451572Z","ReferenceNumber":null,"ExternalReferenceNumber":null,"FeedbackDateUTC":null,"SpecificLocation":null,"NumberObserved":null,"AssessmentTitle":null,"Note":null,"FeedbackNote":null,"PositiveNote":null,"ObserveeNote":null,"IncidentDisplayKey":null,"Coach":null,"Version":0,"AttachmentList":{"AddAttachmentUrl":"api/assessments/0/attachments","Items":[]}}

when i tried to add request template and called the service by passing input params from js code am getting Json syntex error 10302, please find the attached request template configured in MF console

attaching request template

you must create the input parameters for the service, for each property of the body json that is a variable. If your json is not fixed, I'll copy an example

if the json that you are going to call is not a fixed, fixed structure, but a variable or an array, arm the JSON body in the KONY enterprice in a module and pass it as a variable to the service call and that you place it as a parameter